Lintcheck: Add `--warn-all` and make it the CI default
This PR adds a new `--warn-all` flag to lintcheck. This is intended for our CI, as it currently doesn't detect changes of `nursery` and `restriction` lints.
I only made it the default for the CI, as `restriction` lints tend to generate A LOT of lint triggers. Looking at you [`clippy::implicit_return`](https://rust-lang.github.io/rust-clippy/master/index.html#/clippy::implicit_return)
That's it. Should hopefully be easy to review.
Also, a bit thanks again to `@Alexendoo` for adding this to our CI ❤️
---
r? `@Alexendoo`
changelog: none
Refactor `disallowed_methods` and narrow span
Using the span of the call site just produces noisy diagnostics for long calls. Especially multi-line calls.
changelog: none
Clarify that `modulo_one` only applies to ints
changelog: [`modulo_one`]: (docs) Clarify that it only applies to integers
This might be nitpicky, but it's more technically correct.
It also helps if a user skims through the docs, because they may believe it also applies to `{float}`s. This doc edit minimizes that possibility
Rename thread_local_initializer_can_be_made_const to missing_const_for_thread_local
Close#12934
As discussed at #12934 name `thread_local_initializer_can_be_made_const` sounds against convention for other lints which describe the issue/wrong code but not suggestion and it is quite long. The new name take example from existing lint `missing_const_for_fn`
changelog: `thread_local_initializer_can_be_made_const` : Rename to [`missing_const_for_thread_local`]
feat: add cfg_not_test lint
<!--
- \[x] Followed [lint naming conventions][lint_naming]
- \[x] Added passing UI tests (including committed `.stderr` file)
- \[x] `cargo test` passes locally
- \[x] Executed `cargo dev update_lints`
- \[ ] Added lint documentation
- \[x] Run `cargo dev fmt`
[lint_naming]: https://rust-lang.github.io/rfcs/0344-conventions-galore.html#lints
-->
Fixes#11234
changelog: new lint: [`cfg_not_test`]
I don't know whether to lint only the `attr` or also the item associated to it. I guess this would mean putting the check in another place than `check_attribute` but I can't find a way to get the associated item to the attribute.
Also, I'm not sure how to document this lint, I feel like my explications are bad.
Remove `is_in_test_module_or_function`
Uses are replaced with `is_in_test` for consistency with other lints and to simplify the implementation of the lints. This means the module name is no longer checked, but that was a horrible hack from a time when late passes couldn't see `#[cfg(..)]` attributes.
changelog: none