Commit graph

296 commits

Author SHA1 Message Date
bors
c2534dcc49 Auto merge of #13460 - ROMemories:feat/freq-units-allowed-idents, r=Centri3
Add units/unit prefixes of frequency to doc-valid-idents

These units/unit prefixes often come up in the embedded world.

Should this PR also modify the `test_units` test? It seems only concerned with data units currently; should it also test frequency units?

changelog: [`doc_markdown`]: Add MHz, GHz, and THz to `doc-valid-idents`.
2024-10-24 08:50:36 +00:00
GnomedDev
979e297189
Update book 2024-10-13 21:17:03 +01:00
GnomedDev
26994e2519
Reduce default 'large array' threshold 2024-10-04 19:07:40 +01:00
Yuri Astrakhan
73a16c10db Suggest Option<&T> instead of &Option<T> 2024-09-28 11:57:34 -04:00
ROMemories
62026c3228 Add units/unit prefixes of frequency to doc-valid-idents 2024-09-26 10:07:10 +02:00
Ruairidh Williamson
05ebce8e1a
Add lint unused_trait_names 2024-09-21 00:56:38 +01:00
Alex Macleod
a22ce2d005 Remove HashSets from Conf 2024-08-12 20:24:47 +00:00
Alex Macleod
182cd5f278 Replace the metadata collector with tests 2024-08-12 20:24:46 +00:00
Jason Newcomb
7422202ca5 Add missing default values 2024-07-27 23:34:16 -04:00
Jason Newcomb
84dc56923b Add docs for await_holding_invalid_types 2024-07-27 18:17:26 -04:00
xFrednet
e34db99b2e
Update version attribute for 1.80 lints 2024-07-18 20:13:39 +02:00
Jason Newcomb
e34c6dbae5 Refactor for using config values:
* Construct lint passes by taking `Conf` by reference.
* Use `HashSet` configs in less places
* Move some `check_crate` code into the pass constructor when possible.
2024-07-17 14:05:49 -04:00
Bruce Mitchener
39378cf4f4 Add more doc-valid-idents
* "AccessKit" is a commonly used accessibility toolkit used in Rust GUIs.
* "CoreFoundation", "CoreGraphics", "CoreText" are frameworks on Apple OSes.
* "Direct2D", "Direct3D", "DirectWrite" are frameworks on Windows
* "PostScript" is a programming language and is mentioned when talking about
  text and vector graphics.
* "OpenAL" is an audio framework / API.
* "OpenType" is a font format (TrueType is already mentioned).
* "WebRTC", "WebSocket", "WebTransport" are web networking technologies.
* "NetBSD" and "OpenBSD" are like the already included FreeBSD.
2024-07-13 15:50:29 +07:00
Philipp Krones
ae47b97655
needless-pass-by-ref-mut: Update conf documentation 2024-07-03 09:53:05 +02:00
Kornel
eb33c1ac74
Image-related valid idents 2024-06-29 12:18:09 +01:00
Philipp Krones
e9e7a815a7
Merge remote-tracking branch 'upstream/master' into rustup 2024-06-27 18:49:59 +02:00
Reilly Tucker Siemens
80b25b4c82
Fix doc_markdown DevOps false positive 2024-06-26 15:22:38 -07:00
xFrednet
1b4c281fe7 RFC 2383: Stabilize lint_reasons in Clippy 🖇️ 2024-06-25 17:50:48 +02:00
bors
6172178d22 Auto merge of #12938 - elijah-potter:patch-1, r=flip1995
Fix minor typo

changelog: none
2024-06-17 08:35:44 +00:00
Elijah Potter
bcc7b0e700 Fix minor typo 2024-06-15 13:59:35 -06:00
AurelienFT
63388cbab8 add MSRV for manual_pattern_char_comparison 2024-06-15 21:45:35 +02:00
Philipp Krones
3bff119f63 Merge commit '3e5a02b13b1244545454752c6629b767522a44b1' into clippy-subtree-update 2024-06-13 12:30:48 +02:00
Renato Lochetti
9173c58e68
Using Clippy as a proper noun when refering to the unique entity Clippy 2024-06-03 20:46:05 +01:00
Philipp Krones
f67f72695a Merge commit 'c9139bd546d9cd69df817faeab62c5f9b1a51337' into clippy-subtree-update 2024-05-30 10:49:05 +02:00
finga
e61288cbf0 book: Fix example code
Fix example code of the "Disabling evaluation of certain code" section
in the configuration chapter.
2024-05-25 21:36:49 +02:00
Kevin Reid
0f5338cd90 For restriction lints, replace “Why is this bad?” with “Why restrict this?”
The `restriction` group contains many lints which are not about
necessarily “bad” things, but style choices — perhaps even style choices
which contradict conventional Rust style — or are otherwise very
situational. This results in silly wording like “Why is this bad?
It isn't, but ...”, which I’ve seen confuse a newcomer at least once.

To improve this situation, this commit replaces the “Why is this bad?”
section heading with “Why restrict this?”, for most, but not all,
restriction lints. I left alone the ones whose placement in the
restriction group is more incidental.

In order to make this make sense, I had to remove the “It isn't, but”
texts from the contents of the sections. Sometimes further changes
were needed, or there were obvious fixes to make, and I went ahead
and made those changes without attempting to split them into another
commit, even though many of them are not strictly necessary for the
“Why restrict this?” project.
2024-05-23 15:51:33 -07:00
Daniel Sedlak
c342a61564 Add configuration option for ignoring panic!() in tests 2024-05-16 05:45:56 +00:00
y21
9747c80644 new lint: macro_metavars_in_unsafe 2024-05-12 17:03:30 +02:00
J-ZhengLi
46659acdbd add configuration to allow skipping on some certain traits & collect metadata 2024-05-12 22:13:17 +08:00
bors
d8e76ecaf1 Auto merge of #12596 - ARandomDev99:issue-12595, r=Alexendoo
Modify lint pass note for consistency with the book

This PR:
- removes the note which appears when an early lint pass is created using `cargo dev new_lint`.
- adds a note that encourages contributors to use an early pass unless type information is needed if a late lint pass is created using `cargo dev new_lint`.

Late pass remains the default value if no pass is specified as most lints use late pass.

Closes #12595

changelog: none
2024-04-30 12:51:27 +00:00
Andre Bogus
87efce4fa2 configurably allow useless_vec in tests
This adds a `àllow-useless-vec-in-test` configuration which, when set
to `true` will allow the `useless_vec` lint in `#[test]` functions and
code within `#[cfg(test)]`. It also moves a `is_in_test` helper to
`clippy_utils`.
2024-04-28 22:07:56 +02:00
Aneesh Kadiyala
e2861d5652 Encourage using LateLintPass 2024-04-29 00:30:23 +05:30
Alex Macleod
f7aef635c1 Rework interior mutability detection 2024-04-18 17:33:39 +00:00
Alex Macleod
1fff3bef4d Add cargo dev setup toolchain 2024-04-16 18:28:07 +00:00
bors
832fdb6d30 Auto merge of #12573 - modelflat:recognize-common-prepositions-in-module-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`]
2024-04-12 18:53:03 +00:00
Philipp Krones
23225e15d0
Consistent lint group table in book and README
The lint table and the restriction group description was improved in #10385,
but only in the README. Apply the same changes to the book.
2024-04-09 10:48:29 +02:00
modelflat
3705073a71 Recognize common prefixes when checking for items with module name suffix
Fixes #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
2024-04-09 09:47:54 +02:00
Philipp Krones
277303b210
Merge remote-tracking branch 'upstream/master' into rustup 2024-04-04 19:48:31 +02:00
Francisco Salgueiro
b6486fae5c
add missing links in development guide 2024-04-03 17:07:12 +01:00
bors
cebf879de8 Auto merge of #12312 - pitaj:legacy_numeric_constants, r=xFrednet
new lint `legacy_numeric_constants`

Rework of #10997

- uses diagnostic items
- does not lint imports of the float modules (`use std::f32`)
- does not lint usage of float constants that look like `f32::MIN`

I chose to make the float changes because the following pattern is actually pretty useful
```rust
use std::f32;
let omega = freq * 2 * f32::consts::PI;
```
and the float modules are not TBD-deprecated like the integer modules.

Closes #10995

---

changelog: New lint [`legacy_numeric_constants`]
[#12312](https://github.com/rust-lang/rust-clippy/pull/12312)
2024-03-30 17:50:36 +00:00
bors
13ef8457be Auto merge of #12481 - xFrednet:add-team-docs, r=flip1995
RFC: Document Clippy's teams and team duties

First the big announcement:

**We want to add a new subteam for regular contributors to give them triage rights.**

---

This PR adds a new section to the book which describes the Clippy and Clippy-Contributor teams, with their duties and membership requirements. This is just an initial draft, that outlines what, I think, their responsibilities should be.

I hope everyone in the team is okay with me posting this directly to GitHub. I think a PR makes collaboration a bit easier.

[🖼️ Rendered 🖼️](https://github.com/xFrednet/rust-clippy/blob/add-team-docs/book/src/development/the_team.md)

---

Once we've decided on this document, I'll create a PR to add the new team on GitHub. As part of this, we'll also reach out to some active contributors, to ask if they would like to join the new team.

---

cc: `@rust-lang/clippy`

cc: #6627

changelog: none

r? `@flip1995`
2024-03-26 09:01:41 +00:00
León Orell Valerian Liehr
b7026f87f5 Update (doc) comments
Several (doc) comments were super outdated or didn't provide enough context.

Some doc comments shoved everything in a single paragraph without respecting
the fact that the first paragraph should be a single sentence because rustdoc
treats these as item descriptions / synopses on module pages.
2024-03-22 06:31:51 +01:00
Catherine
0c392d918a new lint legacy_numeric_constants 2024-03-21 17:10:02 -06:00
Philipp Krones
0e62b18435 Merge commit '9d6f41691ed9dbfaec2a2df2661c42451f2fe0d3' into clippy-subtree-update 2024-03-21 22:20:40 +01:00
humannum14916
7c0b2dd352 Add assigning_clones to MSRV config option docs 2024-03-19 17:12:16 -04:00
xFrednet
b34afba5fb
Apply pretty review comments =^.^= 2024-03-18 14:32:02 +01:00
xFrednet
4cbe42e00d
RFC: Document Clippy's teams and team duties
I want to be clear: this is just the initial draft outlining what, I think, should be the responsibilities of the team members. It has not yet been discussed with anyone else.
2024-03-13 22:11:51 +01:00
Christopher B. Speir
d66a0ec714 Fix typo in section '6.10. Macro Expansions' of the Clippy Book
The struct returned by the `Span::ctxt` method was listed as
`SpanContext`. The correct struct is currently named `SyntaxContext`.
2024-03-11 13:31:02 -05:00
Philipp Krones
7e83df4068 Merge commit '93f0a9a91f58c9b2153868f458402155fb6265bb' into clippy-subtree-update 2024-03-07 17:19:29 +01:00
Quinn Sinclair
19c2aba3e9 address review comments 2024-03-03 18:12:41 +01:00