Commit Graph

206 Commits

Author SHA1 Message Date
Quinn Sinclair
a6fc64bb7b Trait checking and type construction 2024-03-03 18:12:41 +01:00
Christopher B. Speir
d85642e6e8 Alphabetize configuration options and lints in Clippy doc 2024-02-26 14:55:45 -06:00
Philipp Krones
6d0b70e08f
Clean up Allowing/Denying Lints section 2024-02-26 16:43:05 +01:00
lucarlig
80bafa5d45 add cargo.toml lint section way of adding lints 2024-02-26 18:59:05 +04:00
Alex Macleod
740d89ee69 Remove $DIR replacement in docs sampling stderr files 2024-02-17 12:34:54 +00:00
bors
32c006ca94 Auto merge of #12292 - GuillaumeGomez:DEPRECATED_CLIPPY_CFG_ATTR, r=flip1995
Add new lint `DEPRECATED_CLIPPY_CFG_ATTR`

As discussed [on zulip](https://rust-lang.zulipchat.com/#narrow/stream/257328-clippy/topic/Is.20.60--cfg.20feature.3Dcargo-clippy.60.20deprecated.20or.20can.20it.20be.3F).

This lint suggests to replace `feature = "cargo-clippy"` with `clippy`.

r? `@flip1995`

changelog:  Add new lint `DEPRECATED_CLIPPY_CFG_ATTR`
2024-02-16 10:24:15 +00:00
Guillaume Gomez
f4a3db8e4e Update clippy book to mention cfg(clippy) instead of feature cargo-clippy 2024-02-15 11:52:53 +01:00
Lukas Eschbacher
2b89cd4bf6
fix broken URL in Lint Configuration
Signed-off-by: Lukas Eschbacher <eschbacher.lukas@gmail.com>
2024-02-11 13:20:25 +01:00
y21
7f80b449f5 new lint: manual_c_str_literals 2024-02-05 18:51:49 +01:00
J-ZhengLi
46dd8263a0 rename conf option to allowed_wildcard_imports 2024-02-02 09:22:42 +08:00
Marc Dominik Migge
e456c28e11 Don't warn about modulo arithmetic when comparing to zero
Add lint configuration for `modulo_arithmetic`

Collect meta-data
2024-01-25 12:42:53 +01:00
y21
95a084f2eb [multiple_crate_versions]: add a configuration option for allowed duplicate dependencies 2024-01-21 03:23:41 +01:00
bors
fe3e6827c3 Auto merge of #12144 - blyxyas:10283-postfix, r=llogiq
Add . to end of lint lists in configuration + Fix typo in pub_underscore_fields_behavior

Fixes https://github.com/rust-lang/rust-clippy/pull/10283#issuecomment-1890600381

In the "/// Lint: " list on each configuration option, you have to end with a dot. If the lint list doesn't have a dot, the configuration won't have documentation.

This PR adds those missing dots in some of the configuration, thus also adding their documentation.

changelog: Fix bug where a lot of config documentation wasn't showing.
changelog: Fix typo in `pub_underscore_fields_behavior` (`PublicallyExported` -> `PubliclyExported`)
2024-01-20 22:58:23 +00:00
Ed Morley
a16a85030c
Add "OpenTelemetry" to default doc_valid_idents
The OpenTelemetry project's name is all one word (see https://opentelemetry.io),
so currently triggers a false positive in the `doc_markdown` lint.

The project is increasing rapidly in popularity, so it seems like a worthy
contender for inclusion in the default `doc_valid_idents` configuration.

I've also moved the existing "OpenDNS" entry earlier in the list, to restore
the alphabetical ordering of that "Open*" row.

The docs changes were generated using `cargo collect-metadata`.

changelog: [`doc_markdown`]: Add `OpenTelemetry` to the default configuration as an allowed identifier
2024-01-15 14:26:41 +00:00
blyxyas
44f5d969d5
Change PublicallyExported -> PubliclyExported 2024-01-14 01:14:05 +01:00
blyxyas
2469784cb6
Add . to end of lint lists in configuration 2024-01-14 01:06:35 +01:00
Georgiy Komarov
2dba787c90
Update URLs in Type Checking 2024-01-05 12:54:53 -03:00
bors
ee8bfb7f7a Auto merge of #12051 - y21:option_as_ref_cloned, r=dswij
new lint: `option_as_ref_cloned`

Closes #12009

Adds a new lint that looks for `.as_ref().cloned()` on `Option`s. That's the same as just `.clone()`-ing the option directly.

changelog: new lint: [`option_as_ref_cloned`]
2024-01-05 06:39:46 +00:00
bors
0bf0b88035 Auto merge of #12025 - jetlime:master, r=flip1995
Include GitLab in the CI section of the clippy doc book

Fixes #12012
changelog: Docs: [`Continuous Integration`] now includes how to use clippy in GitLab CI.
2024-01-04 10:48:53 +00:00
Paul Houssel
89e4b7162c
Include GitLab in the CI section of the clippy doc book 2024-01-04 11:43:38 +01:00
bors
691d4e275a Auto merge of #12023 - waywardmonkeys:ci-update-checkout-action, r=flip1995
ci: Update to `actions/checkout@v4` from `v3`.

This also updates the book's section on CI for the same thing.

changelog: none
2024-01-04 10:28:38 +00:00
y21
5960107415 new lint: option_as_ref_cloned 2024-01-03 19:40:47 +01:00
Yuxiang Qiu
88541d6637
fix some typos 2024-01-02 19:21:51 -05:00
Parker Timmerman
fa7dd1c4e0
add new lint, pub_underscore_fields
- add a new late pass lint, with config options
- add ui tests for both variations of config option
- update CHANGELOG.md

github feedback

bump version to 1.77 and run cargo collect-metadata

Change `,` to `;` in `conf.rs`
2023-12-29 11:44:34 +01:00
Bruce Mitchener
4c64d7cea2 ci: Update to actions/checkout@v4 from v3.
This also updates the book's section on CI for the same thing.

changelog: none
2023-12-26 18:43:16 -05:00
Bruce Mitchener
f48b850c65 [doc_markdown]: Add "WebGL2", "WebGPU" to default doc_valid_idents 2023-12-26 16:58:43 -05:00
Samuel Tardieu
a7c59aba20 TypeckResults::node_type() can be used inside of bodies 2023-11-26 22:30:16 +01:00
Alex Macleod
7093444bfa Use absolute path for declare_tool_lint in declare_clippy_lint 2023-11-25 17:45:27 +00:00
Matthias Richter
c18e6abdca Add documentation update hint
This adds a hint to update the documentation in the book after changing the lint configuration
2023-11-23 01:38:56 +01:00
bors
c24784ed81 Auto merge of #11757 - matthri:iter-kv-map-msrv-fix, r=Alexendoo
Fix iter_kv_map false positive into_keys and into_values suggestion

fixes: #11752

changelog: [`iter_kv_map`]: fix false positive: Don't suggest `into_keys()` and `into_values()` if the MSRV is to low
2023-11-22 20:39:44 +00:00
Matthias Richter
a20f61b194 add iter_kv_map to msrv config 2023-11-22 15:19:18 +01:00
Guillaume Gomez
abd9deb9f4 [missing_safety_doc], [unnecessary_safety_doc], [missing_panics_doc], [missing_errors_doc]: Added the [check-private-items] configuration to enable lints on private items.
[#11842](https://github.com/rust-lang/rust-clippy/pull/11842)
2023-11-21 11:42:42 +01:00
Alex Macleod
f1979d48d7 Destructure Conf in register_lints 2023-11-10 23:47:52 +00:00
y21
b9efa3ee2c update references of clippy_utils::msrvs and clippy_lints::util::conf 2023-11-04 01:15:32 +01:00
Alex Macleod
7df1c8aa78 Hide config implementation details from public docs 2023-10-24 11:52:17 +00:00
Alex Macleod
4622203c9b Move configuration to new clippy_config crate 2023-10-23 20:05:10 +00:00
Alex Macleod
7347c1803f Set existing doc-tests to no_run 2023-10-23 15:28:26 +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
Caio
8c0870de7f Address comment 2023-10-13 10:31:02 -03:00
Caio
d1796054fe Document conflicting lints 2023-10-13 10:09:58 -03:00
Michael Schubart
0f8b8625bd Fix documentation link
The file pointed to by the old link

557f6848bd/clippy_lints/src/lib.rs (L110)

did not talk about categories and levels.

The new link (hopefully) points here

https://doc.rust-lang.org/stable/clippy/

which has a nice table explaining the mappings.
2023-10-01 16:44:30 +01:00
Alex Macleod
ec2f62677f Add manual_hash_one lint 2023-09-26 13:49:15 +00:00
Trevor Gross
1b3e5dd0fc Change default configuration of undocumented_unsafe_blocks
This patch sets the two configuration options for
`undocumented_unsafe_blocks` to `true` by default: these are
`accept-comment-above-statement` and `accept-comment-above-attributes`.
Having these values `false` by default prevents what many users would
consider clean code, e.g. placing the `// SAFETY:` comment above a
single-line functino call, rather than directly next to the argument.

changelog: [`undocumented_unsafe_blocks`]: set
`accept-comment-above-statement` and `accept-comment-above-attributes`
to `true` by default.
2023-09-20 03:41:33 -04:00
y21
981e96008b new lint: path_ends_with_ext 2023-09-15 16:17:51 +02:00
bors
60a18b7831 Auto merge of #11449 - blyxyas:book-write_tests, r=flip1995
Should be final writing_tests commit

Fixes that book `FIXME`.

r? `@flip1995`
changelog: none
2023-09-03 20:25:41 +00:00
bors
b65e544535 Auto merge of #10626 - blyxyas:book-trait_checking, r=flip1995
Clippy Book Chapter Updates Reborn: Trait Checking

This PR adds a new chapter to the book: "Trait Checking". No major changes from the source (just some typos, re-phrasing, the usual).

## Notes

- Does not require any other PR to be merged.
- To talk about the whole project, please use the tracking issue for the project #10597 (It also contains a timeline, discussions and more information)

changelog: Add a new "Trait Checking" chapter to the book
2023-09-02 11:21:48 +00:00
blyxyas
92d47dbb29
Add emitting_lints link to Writing tests and remove that FIXME 2023-09-02 12:26:13 +02:00
bors
3cf1087dcd Auto merge of #10598 - blyxyas:book-emit_lints, r=flip1995
Clippy Book Chapter Updates Reborn: Emitting lints

The PR adds a new chapter to the book: "Emitting lints". This time it changed a lot from the old source file.

## Notes

- For discussion about  the whole project, please use the tracking issue for the project #10597 (It also contains a timeline, discussions, and more information)

changelog: Add a new "Emitting lints" chapter to the book

r? `@flip1995`
2023-09-02 09:49:57 +00:00