Skip to content

Contribution guidelines#2726

Open
djc wants to merge 2 commits into
mainfrom
contributing
Open

Contribution guidelines#2726
djc wants to merge 2 commits into
mainfrom
contributing

Conversation

@djc

@djc djc commented Jul 10, 2026

Copy link
Copy Markdown
Member

This is based on rustls' guidelines, with an AI policy adapted from ripgrep's.

Comment thread CONTRIBUTING.md
Comment on lines +43 to +46
AI is useful when communicating as a non-native English speaker. If you are using AI to edit your
comments for this purpose, please take the time to ensure it reflects your own voice and ideas.
When using AI for translation, we recommend writing in your native language and including the AI
translation in a quote block.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is very nice, might be worth putting higher up in this section.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Hmm, not sure -- I think at the bottom is probably okay for this since the other points seem more relevant to most consumers.

Comment thread CONTRIBUTING.md
- For large features, file an issue prior to starting work.
This means everyone can see what is in progress prior to a PR.
- Feel free to submit a PR even if the work is not totally finished, for early feedback.
- Prefer not to reference GitHub issue or PR numbers in commit messages.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why is this? I've noticed consuming Quinn commits downstream that it is often a bit hard to find out the reasoning and motivation behind commits. Information that would be more readily available if issues and PRs were mentioned. Usually commit messages are not really part of the review process so they tend to be terse and rely on the PR context.

I'm not asking to change how you work, only curious how this practice came to be. Feel free to ignore :)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The problem is that GitHub generates a lot of spam from these, so for example each rebase (as well as downstream merges) would generate a link in the linked issue, or, worse, a notification for the mentioned user.

Comment thread CONTRIBUTING.md Outdated
Comment thread CONTRIBUTING.md
reviewed the PR yourself before submitting it for review to the maintainers. Do not copy responses
from the AI when replying to questions from maintainers.

This project requires a human in the loop who understands the work produced by AI. Autonomous

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Someone I work with on other projects had questions about this part, in particular the second sentence, which seems fairly broad. Given that the constraints are pretty clearly enumerated in other paragraphs, perhaps this paragraph/sentence should be removed?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

That sounds good to me. As written, this paragraph might cause confusion about people using agentic workflows to draft code locally, which we don't intrinsically object to.

Comment thread CONTRIBUTING.md
reviewed the PR yourself before submitting it for review to the maintainers. Do not copy responses
from the AI when replying to questions from maintainers.

This project requires a human in the loop who understands the work produced by AI. Autonomous

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

That sounds good to me. As written, this paragraph might cause confusion about people using agentic workflows to draft code locally, which we don't intrinsically object to.

Comment thread CONTRIBUTING.md

* Avoid mixing refactoring and functional changes in the same commit if possible
* Make mechanical changes (like renaming or moving code around) in a separate commit
* Isolate updates to `Cargo.lock` in their own commits

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Should we also mention amending/squashing/rebasing PR commits in response to feedback?

Comment thread CONTRIBUTING.md

This can be surprising to many engineers who are used to the bottom-up ordering
used in languages like Python, where items can have a run-time dependency on
other items defined in the same module.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is this paragraph carrying any weight? It reads like it's just throwing shade at Python.

Comment thread CONTRIBUTING.md
generic, or easily confused between different crates. In this case we prefer to
import the symbol name under an alias, or if the parent module name is short,
using a one-level qualified path. E.g. for a crate with a local `Error` type,
prefer to `import std::error::Error as StdError`.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Should this say use?

Comment thread CONTRIBUTING.md
use alloc::vec::Vec;
```

We prefer to reference types and traits by an imported symbol name instead of

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

editorial:

Suggested change
We prefer to reference types and traits by an imported symbol name instead of
We prefer to reference items by an imported symbol name instead of

Comment thread CONTRIBUTING.md
### Exports

We prefer to export types under a single name, avoiding re-exporting types from
the top-level `lib.rs`. The exception to this are "paved path" exports that we

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I don't think this is at all true for Quinn, and I'm pretty happy with that the way it is. We go to some effort exposing a flatter namespace than our internal code organization would naturally yield, regardless of how likely a typical downstream user is to need to name something. We do have some few public modules, but those are mostly limited to cases where all the types are very closely associated and might need a common prefix otherwise. The result is, IMO, substantially more ergonomic for users.

Comment thread CONTRIBUTING.md

### Comments

Crate items should have descriptive doccomments on them. These are required for

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

editorial: I'm skeptical of "doccomments" as one word.

Comment thread CONTRIBUTING.md
is rare and most new types should be exported only from the module in which they
are defined.

### Comments

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Should we talk about non-doc comments?

Comment thread CONTRIBUTING.md

#### Type exhaustiveness

Public enums should be marked as _either_ `#[non_exhaustive]` or `#[allow(clippy::exhaustive_enums)]`.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Do we need to turn this lint on in CI?

Comment thread CONTRIBUTING.md
express that in the [library's defaults][defaults]. It is good to
encode our experience of TLS in this way, and we should not require that
users are experts in TLS to end up with a result that is working,
secure, stable, and performant.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Slightly odd elaboration for Quinn: while TLS is certainly a large part of what we must be wary of overwhelming the user with, there's much more beyond it. Maybe prefix "For example, it is good to ..."?

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.

4 participants