Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
test: migrate the remaining snapshot-test to
insta
#951test: migrate the remaining snapshot-test to
insta
#951Changes from all commits
8a7e83a
6e75e00
487077c
6de3bab
0de8498
090346b
31a53bc
711630a
bb6f363
f081646
4478097
4f5676b
53c008b
6c4d33a
bed214c
f5a8411
5d0fa74
a84bde7
783a94a
69cdcc0
cb54a3c
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doc comment is totally fine and there's no need to change it.
I want to offer a couple of other alternatives which would have also been fine in this context, along with some discussion on which to pick when.
A) This is a private, test-only function whose name already describes what it does. The API works in the "one obvious way" given the function signature. No doc comment would have been okay in this case, since the doc comment here doesn't say anything that would be surprising to a programmer with zero
cargo-semver-checks
familiarity.B) A one-liner doc comment would also have been okay:
/// Recursively lists all files in the directory. Hard and soft links are ignored.
. This variant of the doc comment actually communicates more information than the current one, even though it's shorter: we explicitly call out a design decision that "could have gone either way" and callers might not known which way we picked. We've avoided not-particularly-useful info (e.g.helper function
), so we're helping the reader focus on what's most important or what might be surprising.Option A) is fine for test code like here. Option B) is preferred inside the tool itself, especially if the decision on not following hard and soft links was less obvious and not directly just 5-10 lines below the function signature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is excellent: it succinctly describes the test at the top, it explains why the thing it looks for is a problem, the capitalization and style matches throughout, and the lines aren't too long so it's reasonable to have multiple editors side-by-side without needing to scroll or wrap lines.
Well done! Now this code is super easy to maintain, and I'm happy to merge it.