Skip to content

Commit ceae2f7

Browse files
committed
update snapshots
1 parent a52f883 commit ceae2f7

File tree

3 files changed

+12
-21
lines changed

3 files changed

+12
-21
lines changed

.github/auto-pr-tests/test_issue_01.snapshot

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
================
2-
test gatest ga
3-
================
41
=====CONTENT=====
52

63
.. guideline:: test ga
7-
:id: gui_irRvGs6pQsDQ
4+
:id: gui_3Wl9gOTto7p2
85
:category: advisory
96
:status: draft
107
:release: 1.1.1-1.1.1
@@ -16,13 +13,13 @@ test gatest ga
1613
hehehehe
1714

1815
.. rationale::
19-
:id: rat_dtzzrjsA2ShY
16+
:id: rat_PVjXjtM9G383
2017
:status: draft
2118

2219
test ga
2320

2421
.. non_compliant_example::
25-
:id: non_compl_ex_z824usgcSNr8
22+
:id: non_compl_ex_ABSVsT97MwLG
2623
:status: draft
2724

2825
test ga
@@ -32,7 +29,7 @@ test gatest ga
3229
dfhsdfkjshdfskdjhftest ga
3330

3431
.. compliant_example::
35-
:id: compl_ex_tzRbMfkM4NHX
32+
:id: compl_ex_Z9TjeDsRTnwL
3633
:status: draft
3734

3835
test ga

.github/auto-pr-tests/test_issue_02.snapshot

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
================
2-
reduce-human-error
3-
================
41
=====CONTENT=====
52

63
.. guideline:: Recursive function are not allowed
7-
:id: gui_NR0NkGkFOfEl
4+
:id: gui_9YIhwNMWWGvW
85
:category: required
96
:status: draft
107
:release: 1.3.0-latest
@@ -16,13 +13,13 @@ reduce-human-error
1613
Any function shall not call itself directly or indirectly
1714

1815
.. rationale::
19-
:id: rat_q7Vd2qfzZEpV
16+
:id: rat_ZaZYjwUzZzvU
2017
:status: draft
2118

2219
Recursive functions can easily cause stack overflows, which may result in exceptions or, in some cases, undefined behavior (typically some embedded systems). Although the Rust compiler supports `tail call optimization <https://en.wikipedia.org/wiki/Tail_call>`_\ , this optimization is not guaranteed and depends on the specific implementation and function structure. There is an `open RFC to guarantee tail call optimization in the Rust compiler <https://github.com/phi-go/rfcs/blob/guaranteed-tco/text/0000-explicit-tail-calls.md>`_\ , but this feature has not yet been stabilized. Until tail call optimization is guaranteed and stabilized, developers should avoid using recursive functions to prevent potential stack overflows and ensure program reliability.
2320

2421
.. non_compliant_example::
25-
:id: non_compl_ex_MjZZmMuITSnb
22+
:id: non_compl_ex_imbh3NpZjDSh
2623
:status: draft
2724

2825
The below function ``concat_strings`` is not complaint because it call itself and depending on depth of data provided as input it could generate an stack overflow exception or undefine behavior.
@@ -48,7 +45,7 @@ reduce-human-error
4845
}
4946

5047
.. compliant_example::
51-
:id: compl_ex_SdfkmboJ2Cih
48+
:id: compl_ex_fLIgZp7Lnwpb
5249
:status: draft
5350

5451
The following code implements the same functionality using iteration instead of recursion. The ``stack`` variable is used to maintain the processing context at each step of the loop. This approach provides explicit control over memory usage. If the stack grows beyond a predefined limit due to the structure or size of the input, the function returns an error rather than risking a stack overflow or out-of-memory exception. This ensures more predictable and robust behavior in resource-constrained environments.

.github/auto-pr-tests/test_issue_03.snapshot

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
================
2-
numerics, reduce-human-error, maintainability, portability, surprising-behavior
3-
================
41
=====CONTENT=====
52

63
.. guideline:: Integer shift shall only be performed through `checked_` APIs
7-
:id: gui_L1efkdhJroHY
4+
:id: gui_zMVugBA2A8hz
85
:category: mandatory
96
:status: draft
107
:release: 1.7.0-latest
@@ -32,7 +29,7 @@ numerics, reduce-human-error, maintainability, portability, surprising-behavior
3229
* ``isize``
3330

3431
.. rationale::
35-
:id: rat_eo9iSNAyUWop
32+
:id: rat_Ccy1VVgvSXVr
3633
:status: draft
3734

3835
This is directly inspired by `INT34-C. Do not shift an expression by a negative number of bits or by greater than or equal to the number of bits that exist in the operand <https://wiki.sei.cmu.edu/confluence/display/c/INT34-C.+Do+not+shift+an+expression+by+a+negative+number+of+bits+or+by+greater+than+or+equal+to+the+number+of+bits+that+exist+in+the+operand>`_.
@@ -95,7 +92,7 @@ numerics, reduce-human-error, maintainability, portability, surprising-behavior
9592
This API has consistent behavior across ``Debug`` and ``Release``\ , and makes the programmer intent explicit, which effectively solves this issue.
9693

9794
.. non_compliant_example::
98-
:id: non_compl_ex_4RnVPjQs06uM
95+
:id: non_compl_ex_keoHBPbqHD8t
9996
:status: draft
10097

10198
As seen below in the ``non_compliant_example()`` function:
@@ -131,7 +128,7 @@ numerics, reduce-human-error, maintainability, portability, surprising-behavior
131128
}
132129

133130
.. compliant_example::
134-
:id: compl_ex_n0Is3JLe1YwT
131+
:id: compl_ex_IG96LnSjFLTt
135132
:status: draft
136133

137134
As seen below in the ``compliant_example()`` function:

0 commit comments

Comments
 (0)