Skip to content

Make lint formulation more consistent #10631

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

Closed
bluthej opened this issue Apr 11, 2023 · 2 comments · Fixed by #10638
Closed

Make lint formulation more consistent #10631

bluthej opened this issue Apr 11, 2023 · 2 comments · Fixed by #10638
Labels
A-documentation Area: Adding or improving documentation C-enhancement Category: Enhancement of lints, like adding more cases or adding help messages

Comments

@bluthej
Copy link
Contributor

bluthej commented Apr 11, 2023

Description

When trying to figure out how I should formulate the documentation for clear_with_drain, I had a look at how other lints are formulated, and I found a few different ways which are pretty much equivalent.

Here are the statistics I gathered:

Formulation Number of occurrences
"Checks for usage" 59
"Checks for use" 16
"Checks for usages" 12
"Checks for uses" 6
"Checks for using" 3
"Detect uses" 2
"Detects uses" 2
"Check for use" 1
"Detect use" 1
Total 102

Note: I used case-insensitive search and I made sure plural and singular forms were counted separately by using [^s] in the regexes for singular forms. Also, to double check, the Total is not just the sum of all the occurrences, it was obtained by a single call with a regex that matches all these cases (and more which I did not include because they had 0 occurrences).

These represent about 1/6 of the total number of lints, which is quite significant.

I propose to standardize the formulation, opting for the most frequent one, i.e. Checks for usage. Of course, I am open to picking a different one if a native English speaker (which I'm not) tells me that it is not the most idiomatic 🙂

Version

No response

Additional Labels

@rustbot label +C-enhancement +A-documentation

@rustbot rustbot added A-documentation Area: Adding or improving documentation C-enhancement Category: Enhancement of lints, like adding more cases or adding help messages labels Apr 11, 2023
@xFrednet
Copy link
Member

xFrednet commented Apr 11, 2023

Hey, I think this is a good proposal. You're welcome to create a PR with these changes. We might also be able, to create a custom lint for this :)

@bluthej
Copy link
Contributor Author

bluthej commented Apr 11, 2023

Good idea! I hadn't thought of that 🙂

I will submit a quick PR with the standardized formulation and then open an issue for a new lint.

@bors bors closed this as completed in d2f1b2c Apr 12, 2023
bors added a commit that referenced this issue Jul 9, 2023
"try this" -> "try"

Current help messages contain a mix of "try", "try this", and one "try this instead". In the spirit of #10631, this PR adopts the first, as it is the most concise.

It also updates the `lint_message_conventions` test to catch cases of "try this".

(Aside: #10120 unfairly contained multiple changes in one PR. I am trying to break that PR up into smaller pieces.)

changelog: Make help messages more concise ("try this" -> "try").
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-documentation Area: Adding or improving documentation C-enhancement Category: Enhancement of lints, like adding more cases or adding help messages
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants