-
Notifications
You must be signed in to change notification settings - Fork 16
Defects vs subsets #127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Defects vs subsets #127
Changes from all commits
eb9af15
7fe2a12
6b37575
fa6461f
66fe8af
065ed53
af787c7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -92,10 +92,6 @@ We will examine each part: | |
:scope: module | ||
:tags: numerics | ||
|
||
Code must not rely on Rust's implicit integer wrapping behavior that occurs in release builds. | ||
Instead, explicitly handle potential overflows using the standard library's checked, | ||
saturating, or wrapping operations. | ||
|
||
``guideline`` Title | ||
------------------- | ||
|
||
|
@@ -308,15 +304,29 @@ what it covers. | |
Content **SHOULD** aim to be as short and self-contained as possible, while still explaining | ||
the scope of the guideline. | ||
|
||
Content **SHOULD NOT** cover the rationale for the guideline, which is done in the ``rationale`` section. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you mentioned about removing the IETF RFC 2119-styling to this chapter when it was intended for readers. Now that it's intended for contributors are you thinking to keep it in? Or is this change unrelated to that to aid in understanding? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps this was rewritten in order to read better? Curious to hear your thoughts. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did you have some thoughts on this? Could we make use of MUST and MAY to specify which contents must be included and which ones are optional? |
||
Guideline content consists of an Amplification and any Exceptions, which are normative, | ||
supported by a Rationale and examples, which are not normative. | ||
The justification extended explanation for the guideline **SHOULD** appear in the non-normative | ||
Rationale rather than in the normative content. | ||
|
||
Amplification | ||
^^^^^^^^^^^^^ | ||
|
||
Guideline Content **MAY** contain a section titled *Amplification* followed by text that provides a more | ||
precise description of the guideline title. An amplification is normative; if it conflicts with the | ||
``guideline`` Title, the amplification **MUST** take precedence. This mechanism is convenient as it allows | ||
a complicated concept to be conveyed using a short Title. | ||
The *Amplification* is the block of text that **MAY** appear immediately below the guideline | ||
attribute block, before any other subheadings. | ||
If it is provided, the Amplification is normative; if it conflicts with the ``guideline`` Title, | ||
the Amplification **MUST** take precedence. This mechanism is convenient as it allows a complicated | ||
concept to be conveyed using a short Title and refined by the text below. | ||
|
||
Content in the Amplification **SHOULD NOT** cover the rationale for the guideline or any | ||
non-normative explanations, which **SHOULD** be provided in the ``rationale`` and examples sections | ||
where helpful. | ||
|
||
:: | ||
|
||
Code must not rely on Rust's implicit integer wrapping behavior that occurs in release builds. | ||
Instead, explicitly handle potential overflows using the standard library's checked, | ||
saturating, or wrapping operations. | ||
|
||
Exception | ||
^^^^^^^^^ | ||
|
@@ -327,9 +337,17 @@ some guidelines to be simplified. It is important to note that an exception is a | |
a guideline does not apply. Code that complies with a guideline by virtue of an exception does not | ||
require a deviation. | ||
|
||
If it is provided, the Exception is normative; if it conflicts with the ``guideline`` Title or the | ||
Amplification, the Exception takes precedence over both. Depending on the individual guideline, it | ||
may be clearer to have an Amplification or Title with an explicit Exception overriding parts of | ||
their description, or it may be clearer to express excepted cases as integrated sentences in the | ||
Amplification. This decision is editorial. | ||
|
||
``rationale`` | ||
============= | ||
|
||
Each Guideline **MUST** provide a *Rationale* for its inclusion and enforcement. | ||
|
||
:: | ||
|
||
.. rationale:: | ||
|
@@ -363,7 +381,13 @@ The ``status`` option of a ``rationale`` **MUST** match the ``status`` of its pa | |
Rationale Content | ||
----------------- | ||
|
||
TODO(pete.levasseur) | ||
The content of the rationale **SHOULD** provide the relevant context for why this guideline is useful. | ||
AlexCeleste marked this conversation as resolved.
Show resolved
Hide resolved
|
||
The Rationale **SHOULD** make reference to any undefined behaviors or known errors associated | ||
with the subject of the guideline. | ||
The Rationale **MAY** make reference to other guidelines or to external documents cited in the | ||
References. | ||
|
||
The Rationale **SHOULD** be supported by code examples wherever concise examples are possible. | ||
AlexCeleste marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
``non_compliant_example`` | ||
========================= | ||
|
@@ -408,10 +432,10 @@ The ``non_compliant_example`` is neither normative, nor exhaustive. ``guideline` | |
``non_compliant_example`` Code Explanation | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
The Code Explanation of a `non_compliant_example` **MUST** explain in prose the reason the guideline | ||
The Code Explanation of a ``non_compliant_example`` **MUST** explain in prose the reason the guideline | ||
when not applied results in code which is undesirable. | ||
|
||
The Code Explanation of a `non_compliant_example` **MAY** be a simple explanation no longer than | ||
The Code Explanation of a ``non_compliant_example`` **MAY** be a simple explanation no longer than | ||
a sentence. | ||
|
||
The Code Explanation of a ``non_compliant_example`` **SHOULD** be no longer than necessary to explain | ||
|
@@ -435,6 +459,12 @@ than the current guideline. | |
``compliant_example`` | ||
===================== | ||
|
||
A compliant example **SHOULD** be omitted when the guideline forbids an action entirely, i.e. there | ||
is no compliant way to achieve the goal of the non-compliant code, rather than giving an irrelevant | ||
example (or encouraging strange workarounds). | ||
When there is a clear and idiomatic compliant way to achieve the goal, a compliant example **SHOULD** | ||
be provided after the corresponding non-compliant example. | ||
|
||
:: | ||
|
||
.. compliant_example:: | ||
|
Uh oh!
There was an error while loading. Please reload this page.