Skip to content

Commit

Permalink
Auto merge of #13460 - ROMemories:feat/freq-units-allowed-idents, r=C…
Browse files Browse the repository at this point in the history
…entri3

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`.
  • Loading branch information
bors committed Oct 24, 2024
2 parents cefa31a + 62026c3 commit c2534dc
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 23 deletions.
2 changes: 1 addition & 1 deletion book/src/lint_configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ default configuration of Clippy. By default, any configuration will replace the
* `doc-valid-idents = ["ClipPy"]` would replace the default list with `["ClipPy"]`.
* `doc-valid-idents = ["ClipPy", ".."]` would append `ClipPy` to the default list.

**Default Value:** `["KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "AccessKit", "CoreFoundation", "CoreGraphics", "CoreText", "DevOps", "Direct2D", "Direct3D", "DirectWrite", "DirectX", "ECMAScript", "GPLv2", "GPLv3", "GitHub", "GitLab", "IPv4", "IPv6", "ClojureScript", "CoffeeScript", "JavaScript", "PostScript", "PureScript", "TypeScript", "WebAssembly", "NaN", "NaNs", "OAuth", "GraphQL", "OCaml", "OpenAL", "OpenDNS", "OpenGL", "OpenMP", "OpenSSH", "OpenSSL", "OpenStreetMap", "OpenTelemetry", "OpenType", "WebGL", "WebGL2", "WebGPU", "WebRTC", "WebSocket", "WebTransport", "WebP", "OpenExr", "YCbCr", "sRGB", "TensorFlow", "TrueType", "iOS", "macOS", "FreeBSD", "NetBSD", "OpenBSD", "TeX", "LaTeX", "BibTeX", "BibLaTeX", "MinGW", "CamelCase"]`
**Default Value:** `["KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "MHz", "GHz", "THz", "AccessKit", "CoreFoundation", "CoreGraphics", "CoreText", "DevOps", "Direct2D", "Direct3D", "DirectWrite", "DirectX", "ECMAScript", "GPLv2", "GPLv3", "GitHub", "GitLab", "IPv4", "IPv6", "ClojureScript", "CoffeeScript", "JavaScript", "PostScript", "PureScript", "TypeScript", "WebAssembly", "NaN", "NaNs", "OAuth", "GraphQL", "OCaml", "OpenAL", "OpenDNS", "OpenGL", "OpenMP", "OpenSSH", "OpenSSL", "OpenStreetMap", "OpenTelemetry", "OpenType", "WebGL", "WebGL2", "WebGPU", "WebRTC", "WebSocket", "WebTransport", "WebP", "OpenExr", "YCbCr", "sRGB", "TensorFlow", "TrueType", "iOS", "macOS", "FreeBSD", "NetBSD", "OpenBSD", "TeX", "LaTeX", "BibTeX", "BibLaTeX", "MinGW", "CamelCase"]`

---
**Affected lints:**
Expand Down
1 change: 1 addition & 0 deletions clippy_config/src/conf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ use std::{cmp, env, fmt, fs, io};
#[rustfmt::skip]
const DEFAULT_DOC_VALID_IDENTS: &[&str] = &[
"KiB", "MiB", "GiB", "TiB", "PiB", "EiB",
"MHz", "GHz", "THz",
"AccessKit",
"CoreFoundation", "CoreGraphics", "CoreText",
"DevOps",
Expand Down
1 change: 1 addition & 0 deletions tests/ui/doc/doc-fixable.fixed
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ fn test_units() {

/// This tests allowed identifiers.
/// KiB MiB GiB TiB PiB EiB
/// MHz GHz THz
/// AccessKit
/// CoreFoundation CoreGraphics CoreText
/// Direct2D Direct3D DirectWrite DirectX
Expand Down
1 change: 1 addition & 0 deletions tests/ui/doc/doc-fixable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ fn test_units() {

/// This tests allowed identifiers.
/// KiB MiB GiB TiB PiB EiB
/// MHz GHz THz
/// AccessKit
/// CoreFoundation CoreGraphics CoreText
/// Direct2D Direct3D DirectWrite DirectX
Expand Down
44 changes: 22 additions & 22 deletions tests/ui/doc/doc-fixable.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ LL | /// `be_sure_we_got_to_the_end_of_it`
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

error: item in documentation is missing backticks
--> tests/ui/doc/doc-fixable.rs:78:5
--> tests/ui/doc/doc-fixable.rs:79:5
|
LL | /// be_sure_we_got_to_the_end_of_it
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -144,7 +144,7 @@ LL | /// `be_sure_we_got_to_the_end_of_it`
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

error: item in documentation is missing backticks
--> tests/ui/doc/doc-fixable.rs:95:5
--> tests/ui/doc/doc-fixable.rs:96:5
|
LL | /// be_sure_we_got_to_the_end_of_it
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -155,7 +155,7 @@ LL | /// `be_sure_we_got_to_the_end_of_it`
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

error: item in documentation is missing backticks
--> tests/ui/doc/doc-fixable.rs:103:8
--> tests/ui/doc/doc-fixable.rs:104:8
|
LL | /// ## CamelCaseThing
| ^^^^^^^^^^^^^^
Expand All @@ -166,7 +166,7 @@ LL | /// ## `CamelCaseThing`
| ~~~~~~~~~~~~~~~~

error: item in documentation is missing backticks
--> tests/ui/doc/doc-fixable.rs:106:7
--> tests/ui/doc/doc-fixable.rs:107:7
|
LL | /// # CamelCaseThing
| ^^^^^^^^^^^^^^
Expand All @@ -177,7 +177,7 @@ LL | /// # `CamelCaseThing`
| ~~~~~~~~~~~~~~~~

error: item in documentation is missing backticks
--> tests/ui/doc/doc-fixable.rs:108:22
--> tests/ui/doc/doc-fixable.rs:109:22
|
LL | /// Not a title #897 CamelCaseThing
| ^^^^^^^^^^^^^^
Expand All @@ -188,7 +188,7 @@ LL | /// Not a title #897 `CamelCaseThing`
| ~~~~~~~~~~~~~~~~

error: item in documentation is missing backticks
--> tests/ui/doc/doc-fixable.rs:109:5
--> tests/ui/doc/doc-fixable.rs:110:5
|
LL | /// be_sure_we_got_to_the_end_of_it
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -199,7 +199,7 @@ LL | /// `be_sure_we_got_to_the_end_of_it`
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

error: item in documentation is missing backticks
--> tests/ui/doc/doc-fixable.rs:116:5
--> tests/ui/doc/doc-fixable.rs:117:5
|
LL | /// be_sure_we_got_to_the_end_of_it
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -210,7 +210,7 @@ LL | /// `be_sure_we_got_to_the_end_of_it`
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

error: item in documentation is missing backticks
--> tests/ui/doc/doc-fixable.rs:129:5
--> tests/ui/doc/doc-fixable.rs:130:5
|
LL | /// be_sure_we_got_to_the_end_of_it
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -221,7 +221,7 @@ LL | /// `be_sure_we_got_to_the_end_of_it`
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

error: item in documentation is missing backticks
--> tests/ui/doc/doc-fixable.rs:140:43
--> tests/ui/doc/doc-fixable.rs:141:43
|
LL | /** E.g., serialization of an empty list: FooBar
| ^^^^^^
Expand All @@ -232,7 +232,7 @@ LL | /** E.g., serialization of an empty list: `FooBar`
| ~~~~~~~~

error: item in documentation is missing backticks
--> tests/ui/doc/doc-fixable.rs:145:5
--> tests/ui/doc/doc-fixable.rs:146:5
|
LL | And BarQuz too.
| ^^^^^^
Expand All @@ -243,7 +243,7 @@ LL | And `BarQuz` too.
| ~~~~~~~~

error: item in documentation is missing backticks
--> tests/ui/doc/doc-fixable.rs:146:1
--> tests/ui/doc/doc-fixable.rs:147:1
|
LL | be_sure_we_got_to_the_end_of_it
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -254,7 +254,7 @@ LL | `be_sure_we_got_to_the_end_of_it`
|

error: item in documentation is missing backticks
--> tests/ui/doc/doc-fixable.rs:151:43
--> tests/ui/doc/doc-fixable.rs:152:43
|
LL | /** E.g., serialization of an empty list: FooBar
| ^^^^^^
Expand All @@ -265,7 +265,7 @@ LL | /** E.g., serialization of an empty list: `FooBar`
| ~~~~~~~~

error: item in documentation is missing backticks
--> tests/ui/doc/doc-fixable.rs:156:5
--> tests/ui/doc/doc-fixable.rs:157:5
|
LL | And BarQuz too.
| ^^^^^^
Expand All @@ -276,7 +276,7 @@ LL | And `BarQuz` too.
| ~~~~~~~~

error: item in documentation is missing backticks
--> tests/ui/doc/doc-fixable.rs:157:1
--> tests/ui/doc/doc-fixable.rs:158:1
|
LL | be_sure_we_got_to_the_end_of_it
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -287,7 +287,7 @@ LL | `be_sure_we_got_to_the_end_of_it`
|

error: item in documentation is missing backticks
--> tests/ui/doc/doc-fixable.rs:168:5
--> tests/ui/doc/doc-fixable.rs:169:5
|
LL | /// be_sure_we_got_to_the_end_of_it
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -298,7 +298,7 @@ LL | /// `be_sure_we_got_to_the_end_of_it`
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

error: item in documentation is missing backticks
--> tests/ui/doc/doc-fixable.rs:187:22
--> tests/ui/doc/doc-fixable.rs:188:22
|
LL | /// An iterator over mycrate::Collection's values.
| ^^^^^^^^^^^^^^^^^^^
Expand All @@ -309,7 +309,7 @@ LL | /// An iterator over `mycrate::Collection`'s values.
| ~~~~~~~~~~~~~~~~~~~~~

error: item in documentation is missing backticks
--> tests/ui/doc/doc-fixable.rs:211:34
--> tests/ui/doc/doc-fixable.rs:212:34
|
LL | /// Foo \[bar\] \[baz\] \[qux\]. DocMarkdownLint
| ^^^^^^^^^^^^^^^
Expand All @@ -320,7 +320,7 @@ LL | /// Foo \[bar\] \[baz\] \[qux\]. `DocMarkdownLint`
| ~~~~~~~~~~~~~~~~~

error: item in documentation is missing backticks
--> tests/ui/doc/doc-fixable.rs:234:22
--> tests/ui/doc/doc-fixable.rs:235:22
|
LL | /// There is no try (do() or do_not()).
| ^^^^
Expand All @@ -331,7 +331,7 @@ LL | /// There is no try (`do()` or do_not()).
| ~~~~~~

error: item in documentation is missing backticks
--> tests/ui/doc/doc-fixable.rs:234:30
--> tests/ui/doc/doc-fixable.rs:235:30
|
LL | /// There is no try (do() or do_not()).
| ^^^^^^^^
Expand All @@ -342,7 +342,7 @@ LL | /// There is no try (do() or `do_not()`).
| ~~~~~~~~~~

error: item in documentation is missing backticks
--> tests/ui/doc/doc-fixable.rs:237:5
--> tests/ui/doc/doc-fixable.rs:238:5
|
LL | /// ABes
| ^^^^
Expand All @@ -353,7 +353,7 @@ LL | /// `ABes`
| ~~~~~~

error: item in documentation is missing backticks
--> tests/ui/doc/doc-fixable.rs:243:9
--> tests/ui/doc/doc-fixable.rs:244:9
|
LL | /// foo()
| ^^^^^
Expand All @@ -364,7 +364,7 @@ LL | /// `foo()`
| ~~~~~~~

error: you should put bare URLs between `<`/`>` or make a proper Markdown link
--> tests/ui/doc/doc-fixable.rs:247:5
--> tests/ui/doc/doc-fixable.rs:248:5
|
LL | /// https://github.com/rust-lang/rust-clippy/pull/12836
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `<https://github.com/rust-lang/rust-clippy/pull/12836>`
Expand Down

0 comments on commit c2534dc

Please sign in to comment.