Skip to content

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

AlexCeleste
Copy link
Collaborator

This adds a basic example of three kinds of guideline:

  • a blanket Advisory subsetting guideline
  • a more targeted decidable Required subsetting guideline
  • a defect-oriented undecidable Required guideline

AlexCeleste and others added 3 commits June 4, 2025 15:53
…n explicit Amplification section exists (instead, whatever paragraph immediately opens the guideline is just normative). We can continue to call it that but the subheading is not necessary.
Co-authored-by: Pete LeVasseur <plevasseur@gmail.com>
Copy link

netlify bot commented Jun 4, 2025

Deploy Preview for scrc-coding-guidelines ready!

Name Link
🔨 Latest commit 065ed53
🔍 Latest deploy log https://app.netlify.com/projects/scrc-coding-guidelines/deploys/686db27caf457e00072cb58f
😎 Deploy Preview https://deploy-preview-127--scrc-coding-guidelines.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Collaborator

@PLeVasseur PLeVasseur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @AlexCeleste for the excellent additions! Could you take a look at the comments I left?

By the way -- I think I recall you saying the plan is to incorporate these examples more into the Style Guideline to help flesh it out. Was that right? In this PR or another?

I suppose then it would be quite helpful to use the examples to illustrate the difference between a defect and subset.

@@ -99,6 +99,10 @@
dict(name="readability", description="Readability-related guideline"),
dict(name="reduce-human-error", description="Reducing human error guideline"),
dict(name="numerics", description="Numerics-related guideline"),
dict(name="undefined-behavior", description="Numerics-related guideline"),

dict(name="defect", description="Guideline associated with the language-subset profile"),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you'd like we can have a new Sphinx Needs option for whether it's a defect or subset.
If we think most guidelines can or should be classified as one or the other it might make sense.
What do you think?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created an issue for this, perhaps we tackle this later:
#142

What do you think @AlexCeleste?

@@ -308,15 +304,27 @@ 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.
Copy link
Collaborator

Choose a reason for hiding this comment

The 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?

Copy link
Collaborator

Choose a reason for hiding this comment

The 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.

Copy link
Contributor

@iglesias iglesias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've checked the additions a few times over the past weeks and they look quite good to me overall.

Copy link
Collaborator

@PLeVasseur PLeVasseur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a couple of thoughts! Thanks a bunch for sweeping through and addressing comments @AlexCeleste

@@ -99,6 +99,10 @@
dict(name="readability", description="Readability-related guideline"),
dict(name="reduce-human-error", description="Reducing human error guideline"),
dict(name="numerics", description="Numerics-related guideline"),
dict(name="undefined-behavior", description="Numerics-related guideline"),

dict(name="defect", description="Guideline associated with the language-subset profile"),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created an issue for this, perhaps we tackle this later:
#142

What do you think @AlexCeleste?

@@ -308,15 +304,27 @@ 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.
Copy link
Collaborator

Choose a reason for hiding this comment

The 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.

Copy link
Collaborator

@PLeVasseur PLeVasseur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missed a comment. Realized we can also use the linking to the standard library for core and other standard library crates as well 🥳

originally performed in a differently-sized address space.

While ``as`` can notionally be used to create a null pointer, the functions
``core::ptr::null`` and ``core::ptr::null_mut`` are the more idiomatic way to do this.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was reading the documentation of the Sphinx coding guidelines extension (again, shamelessly taken from the FLS) and we should also be able to use it with items from core, e.g.

Suggested change
``core::ptr::null`` and ``core::ptr::null_mut`` are the more idiomatic way to do this.
:std:`core::ptr::null` and :std:`core::ptr::null_mut` are the more idiomatic way to do this.

(note the single ticks instead of double ticks)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants