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

[module_name_repetition] Recognize common prepositions #12573

Conversation

modelflat
Copy link
Contributor

@modelflat modelflat commented Mar 27, 2024

Fixes #12544

changelog: [module_name_repetition]: don't report an item name if it consists only of a prefix from allowed-prefixes list and a module name (e.g. AsFoo in module foo). Prefixes allowed by default: [to, from, into, as, try_into, try_from]

@rustbot
Copy link
Collaborator

rustbot commented Mar 27, 2024

r? @Jarcho

rustbot has assigned @Jarcho.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Mar 27, 2024
@Jarcho
Copy link
Contributor

Jarcho commented Mar 30, 2024

'Prefixes' would be a better name than 'prepositions'. TryFrom and TryInto should probably also be in the default list. Otherwise LGTM.

@modelflat modelflat force-pushed the recognize-common-prepositions-in-module-name-repetitions branch 2 times, most recently from 06a1e67 to c97bee6 Compare March 31, 2024 11:24
@modelflat
Copy link
Contributor Author

modelflat commented Mar 31, 2024

@Jarcho thanks for the suggestions! I agree with both - implemented.

@Jarcho
Copy link
Contributor

Jarcho commented Apr 4, 2024

Thank you. @bors r+

@bors
Copy link
Collaborator

bors commented Apr 4, 2024

📌 Commit c97bee6 has been approved by Jarcho

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Apr 4, 2024

⌛ Testing commit c97bee6 with merge 41cb174...

bors added a commit that referenced this pull request Apr 4, 2024
…ule-name-repetitions, r=Jarcho

[`module_name_repetition`] Recognize common prepositions

Fixes #12544

changelog: [`module_name_repetition`]: don't report an item name if it consists only of a prefix from `allowed-prefixes` list and a module name (e.g. `AsFoo` in module `foo`). Prefixes allowed by default: [`to`, `from`, `into`, `as`, `try_into`, `try_from`]
@bors
Copy link
Collaborator

bors commented Apr 4, 2024

💔 Test failed - checks-action_test

…ffix

Fixes rust-lang#12544.

- don't report an item name if it consists only of a prefix from `allowed-prefixes` list and a module name (e.g. `AsFoo` in module `foo`).
- configured by `allowed-prefixes` config entry
- prefixes allowed by default: [`to`, `from`, `into`, `as`, `try_into`, `try_from`]
- update docs
@modelflat modelflat force-pushed the recognize-common-prepositions-in-module-name-repetitions branch from ba25e42 to 3705073 Compare April 9, 2024 07:48
@Jarcho
Copy link
Contributor

Jarcho commented Apr 12, 2024

@bors r+

@bors
Copy link
Collaborator

bors commented Apr 12, 2024

📌 Commit 3705073 has been approved by Jarcho

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Apr 12, 2024

⌛ Testing commit 3705073 with merge 832fdb6...

@bors
Copy link
Collaborator

bors commented Apr 12, 2024

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: Jarcho
Pushing 832fdb6 to master...

1 similar comment
@bors
Copy link
Collaborator

bors commented Apr 12, 2024

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: Jarcho
Pushing 832fdb6 to master...

@bors bors merged commit 832fdb6 into rust-lang:master Apr 12, 2024
8 checks passed
@bors
Copy link
Collaborator

bors commented Apr 12, 2024

👀 Test was successful, but fast-forwarding failed: 422 Changes must be made through a pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Don't report module name repetitions with prepositions, like foo::AsFoo
6 participants