Commit Graph

278 Commits

Author SHA1 Message Date
bors
090df7a8af Auto merge of #11678 - slinkydeveloper:master, r=Alexendoo
Now `declare_interior_mutable_const` and `borrow_interior_mutable_const` respect the `ignore-interior-mutability` configuration entry

Fix #10537

changelog: Now `declare_interior_mutable_const` and `borrow_interior_mutable_const` respect the `ignore-interior-mutability` configuration entry
2023-10-20 16:50:39 +00:00
bors
9574d28cb6 Auto merge of #11683 - Alexendoo:msrv-config, r=Manishearth,flip1995
Deserialize `Msrv` directly in `Conf`

Gives the error a span pointing to the invalid config value

Also puts `Conf` itself in the `OnceLock` rather than just the `Msrv` for [the `register_late_mod_pass` work](https://github.com/rust-lang/rust/pull/116731) since it will be used from two different callbacks

changelog: none
2023-10-19 11:51:08 +00:00
Alex Macleod
1528c1db47 Deserialize Msrv directly in Conf 2023-10-18 20:35:09 +00:00
jonboh
8b02dac542 add lint for struct field names
side effect for `enum_variants`:
use .first() instead of .get(0) in enum_variants lint
move to_camel_case to str_util module
move module, enum and struct name repetitions check to a single file `item_name_repetitions`
rename enum_variants threshold config option
2023-10-18 19:20:08 +02:00
Francesco Guardiani
3960bc024c Now declare_interior_mutable_const and borrow_interior_mutable_const respect the ignore-interior-mutability configuration entry
changelog: Now `declare_interior_mutable_const` and `borrow_interior_mutable_const` respect the `ignore-interior-mutability` configuration entry
Signed-off-by: slinkydeveloper <francescoguard@gmail.com>
2023-10-16 17:08:13 +02:00
bors
bde04824cc Auto merge of #11550 - blyxyas:fix-impl_trait_in_params-for_assocfn, r=dswij
`impl_trait_in_params` now supports impls and traits

Before this PR, the lint `impl_trait_in_params`. This PR gives the lint support for functions in impls and traits. (Also, some pretty heavy refactor)

fixes #11548
changelog:[`impl_trait_in_params`] now supports `impl` blocks and functions in traits
2023-10-08 21:57:56 +00:00
blyxyas
775573768e
Fix tests, only lint for public tests 2023-10-08 23:49:32 +02:00
blyxyas
5ed338dff9
impl_trait_in_params now supports impls and traits 2023-10-08 23:49:32 +02:00
Michael Goulet
56794fa5f1 Fix clippy 2023-10-04 21:09:54 +00:00
Philipp Krones
772296c50e Merge commit '7671c283a50b5d1168841f3014b14000f01dd204' into clippyup 2023-09-25 11:28:58 +02:00
Camille GILLOT
19e160fe2f Bless clippy. 2023-09-23 13:47:30 +00:00
y21
981e96008b new lint: path_ends_with_ext 2023-09-15 16:17:51 +02:00
Ralf Jung
3226e4b010 don't point at const usage site for resolution-time errors
also share the code that emits the actual error
2023-09-14 22:34:05 +02:00
Philipp Krones
471469d30f Merge commit '98363cbf6a7c3f8b571a7d92a3c645bb4376e4a6' into clippyup 2023-09-12 18:44:06 +02:00
Philipp Krones
d2b08432db
Merge remote-tracking branch 'upstream/master' into rustup 2023-09-07 21:43:06 +02:00
bors
0d36d57c41 Auto merge of #11439 - Alexendoo:disallowed-macros-bins-attrs, r=xFrednet
Check binary operators and attributes in disallowed_macros

changelog: none
2023-09-06 11:36:28 +00:00
Urgau
a86e758228 Adjust clippy tests with new rustc help suggestion for lints 2023-09-04 14:22:02 +02:00
bors
bcf856bfb3 Auto merge of #11375 - J-ZhengLi:issue11246, r=Centri3
fix fp when [`undocumented_unsafe_blocks`] not able to detect comment on globally defined const/static variables

fixes: #11246

changelog: fix detection on global variables for [`undocumented_unsafe_blocks`]
2023-09-04 09:47:45 +00:00
Alex Macleod
299fbceb96 Check binary operators and attributes in disallowed_macros 2023-08-31 13:14:44 +00:00
bors
c50d86fc6a Auto merge of #11418 - Benjscho:explicit_iter_loop_config, r=llogiq
Add config flag for reborrows in explicit_iter_loop

This PR adds a config flag for enforcing explicit into iter lint for reborrowed values. The config flag, `enforce_iter_loop_reborrow`, can be added to clippy.toml files to enable the linting behaviour. By default the reborrow lint is disabled.

fixes: #11074

changelog: [`explicit_iter_loop`]: add config flag `enforce_iter_loop_reborrow` to disable reborrow linting by default
2023-08-31 11:19:04 +00:00
Ben Schofield
be55a96d80 Add config flag for reborrows in explicit_iter_loop
This commit adds a config flag for enforcing explicit into iter lint
for reborrowed values. The config flag, enforce_iter_loop_reborrow, can be
added to clippy.toml files to enable the linting behaviour. By default
the lint is not enabled.
2023-08-27 21:45:14 -06:00
Alex Macleod
d78d26a8c7 Remove redundant auxiliary test files 2023-08-25 14:25:49 +00:00
Philipp Krones
cc61aeea54 Merge commit '080b587854a73f2a8cbaecff1884860a78e2ff37' into clippyup 2023-08-24 21:32:12 +02:00
J-ZhengLi
77215672e9 fix [undocumented_unsafe_blocks] not able to detect comment for global vars 2023-08-22 10:27:16 +08:00
Oli Scherer
00919a4f92 Update ui test crate to auto-detect aux build crate kind 2023-08-11 14:02:35 +00:00
Oli Scherer
3d88fae050 Update ui test crate 2023-08-11 14:02:28 +00:00
Philipp Krones
f730a2655a Merge commit '1e8fdf492808a25d78a97e1242b835ace9924e4d' into clippyup 2023-08-11 14:05:13 +02:00
Catherine Flores
71c54137ea Extract never-like into clippy_utils 2023-08-02 14:00:26 -05:00
Philipp Krones
b0e64a9c09 Merge commit '5436dba826191964ac1d0dab534b7eb6d4c878f6' into clippyup 2023-07-31 23:53:53 +02:00
Catherine
9cf1509b25 New lint absolute_paths 2023-07-21 17:26:58 -05:00
Philipp Krones
d6d530fd0b Merge commit 'd9c24d1b1ee61f276e550b967409c9f155eac4e3' into clippyup 2023-07-17 10:22:32 +02:00
Alex Macleod
2811effe34 Add imports_granularity = "Module" to rustfmt.toml 2023-07-13 12:44:57 +00:00
bors
ebd8d31542 Auto merge of #11055 - smoelius:try-this, r=dswij
"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").
2023-07-09 15:07:25 +00:00
Guillaume Gomez
c62c7fadac Update UI tests with new needless_pass_by_ref_mut lint 2023-07-03 22:25:36 +02:00
Philipp Krones
cb3ecf7b79 Merge commit '37f4c1725d3fd7e9c3ffd8783246bc5589debc53' into clippyup 2023-07-02 14:59:02 +02:00
Samuel Moelius
420f3d11e8 "try this" -> "try" 2023-07-01 07:08:01 -04:00
Centri3
8cb6c86996 change category and refactor
Update raw_strings.rs

Revert "new lints for visibility"

This reverts commit 0e5a537d209727169769dc19cf86aef27122c092.

new lints for visibility
2023-06-27 05:16:40 -05:00
Centri3
bc744eb82b new lint needless_raw_string + refactor a bit
Thanks, #112373, for the snippet at line 75!
2023-06-27 05:12:00 -05:00
Oli Scherer
5bd97ac17a Update tests 2023-06-26 14:13:07 +00:00
Centri3
cc2e49f695 allow safety comment above attributes 2023-06-19 23:46:57 -05:00
Renato Lochetti
8625a849d1
adding all ui tests to the configuration test as well 2023-06-17 09:36:38 -03:00
Renato Lochetti
e2e6a02445
Addressing reviewer comments 2023-06-17 09:36:38 -03:00
Renato Lochetti
520228b377
Adding configuration to allow safety comment above stmt containing unsafe block 2023-06-17 09:36:36 -03:00
Pavan Kumar Sunkara
bfd5abad4b Fix all the other tests 2023-06-12 16:21:06 +01:00
y21
c8c7a3c79c fix rebase weirdness 2023-06-12 12:21:38 +02:00
y21
7312a93a06 new lint: large_stack_frames 2023-06-12 12:21:38 +02:00
Centri3
243943ff56 make it work for locals as well
oopos
2023-06-12 03:22:01 -05:00
Centri3
7cdd87ca4a ignore generics and allow arbitrary threshold 2023-06-12 03:22:01 -05:00
Centri3
52cfc997af Add lint single_letter_idents 2023-06-12 03:21:43 -05:00
bors
21e6235b4c Auto merge of #10921 - Centri3:needless_if, r=blyxyas,Manishearth
Add `needless_if` lint

first off: Sorry about the large diff. Seems a ton of tests do this (understandably so).

this is basically everything I wanted in #10868, while it doesn't lint *all* unnecessary empty blocks, it lints needless if statements; which are basically the crux of the issue (for me) anyway. I've committed code that includes this far too many times 😅 hopefully clippy can help me out soon

closes #10868

changelog: New lint [`needless_if`]
2023-06-12 04:18:50 +00:00