Skip to content
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

Document contributor process for adding witness hint templates #933

Merged
merged 7 commits into from
Sep 19, 2024

Conversation

suaviloquence
Copy link
Contributor

Adds information about the witness field and when and how to add a hint template. Also sets the witness to None in make_new_lint.sh, with a link to this new section of the contributor docs.

Rendered view

Copy link
Owner

@obi1kenobi obi1kenobi left a comment

Choose a reason for hiding this comment

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

Looks good! Just some wording nitpicks here and there.

CONTRIBUTING.md Outdated
#### Adding a witness

**Witnesses** are a new, unstable feature of `cargo-semver-checks` that let us create witness
code, a minimal compilable example of potential downstream breakage\. They are configured via the
Copy link
Owner

Choose a reason for hiding this comment

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

I'm curious, what's the reason for the \. everywhere? It's not something I've seen before.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just a bad regex find-and-replace for replacing . with . (extra spaces between periods). 😅

Copy link
Owner

Choose a reason for hiding this comment

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

Ah okay, no worries. You might need to edit my suggestions post-merge then, since I mirrored the \. style.

CONTRIBUTING.md Outdated Show resolved Hide resolved
CONTRIBUTING.md Outdated
{{name}}(...);
```

which could render to something like:
Copy link
Owner

Choose a reason for hiding this comment

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

"Render" is a bit ambiguous here.

Suggested change
which could render to something like:
which in the RON format could be represented like:

CONTRIBUTING.md Outdated Show resolved Hide resolved
CONTRIBUTING.md Outdated Show resolved Hide resolved
CONTRIBUTING.md Outdated Show resolved Hide resolved
CONTRIBUTING.md Outdated Show resolved Hide resolved
CONTRIBUTING.md Outdated Show resolved Hide resolved
CONTRIBUTING.md Outdated Show resolved Hide resolved
CONTRIBUTING.md Outdated
the correct witness hints\. Note that it may contain output for other test crates - this
not necessarily an error: see the troubleshooting section for more info\. Once you've
verified that the `--- actual ---` results are as expected, copy the actual results
into the `test_outputs/witnesses/<lint_name>.output.ron` file and save\. Running
Copy link
Owner

Choose a reason for hiding this comment

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

Is there a viable way to insta this? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Totally! I was matching the behavior of the basic lint tests, but we could definitely use insta here, and it would probably be better for contributor experience (but less consistent)

Copy link
Owner

Choose a reason for hiding this comment

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

I imagine we'll eventually move the existing non-insta steps to insta, so probably best to start standardizing toward the new behavior we'll want eventually anyway. If someone is annoyed at the inconsistency, we can tell them we'd love a PR to move everything to insta 😅

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, I'll open a PR to use insta for the tests instead, then update the docs here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Owner

@obi1kenobi obi1kenobi left a comment

Choose a reason for hiding this comment

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

Awesome 🚀

CONTRIBUTING.md Outdated Show resolved Hide resolved
@obi1kenobi obi1kenobi enabled auto-merge (squash) September 19, 2024 02:04
@obi1kenobi obi1kenobi merged commit 0f67fc4 into obi1kenobi:main Sep 19, 2024
33 checks passed
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.

2 participants