Skip to content

Commit 62026c3

Browse files
committed
Add units/unit prefixes of frequency to doc-valid-idents
1 parent c771204 commit 62026c3

File tree

5 files changed

+26
-23
lines changed

5 files changed

+26
-23
lines changed

book/src/lint_configuration.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ default configuration of Clippy. By default, any configuration will replace the
455455
* `doc-valid-idents = ["ClipPy"]` would replace the default list with `["ClipPy"]`.
456456
* `doc-valid-idents = ["ClipPy", ".."]` would append `ClipPy` to the default list.
457457

458-
**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"]`
458+
**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"]`
459459

460460
---
461461
**Affected lints:**

clippy_config/src/conf.rs

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ use std::{cmp, env, fmt, fs, io};
1717
#[rustfmt::skip]
1818
const DEFAULT_DOC_VALID_IDENTS: &[&str] = &[
1919
"KiB", "MiB", "GiB", "TiB", "PiB", "EiB",
20+
"MHz", "GHz", "THz",
2021
"AccessKit",
2122
"CoreFoundation", "CoreGraphics", "CoreText",
2223
"DevOps",

tests/ui/doc/doc-fixable.fixed

+1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ fn test_units() {
5454

5555
/// This tests allowed identifiers.
5656
/// KiB MiB GiB TiB PiB EiB
57+
/// MHz GHz THz
5758
/// AccessKit
5859
/// CoreFoundation CoreGraphics CoreText
5960
/// Direct2D Direct3D DirectWrite DirectX

tests/ui/doc/doc-fixable.rs

+1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ fn test_units() {
5454

5555
/// This tests allowed identifiers.
5656
/// KiB MiB GiB TiB PiB EiB
57+
/// MHz GHz THz
5758
/// AccessKit
5859
/// CoreFoundation CoreGraphics CoreText
5960
/// Direct2D Direct3D DirectWrite DirectX

tests/ui/doc/doc-fixable.stderr

+22-22
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ LL | /// `be_sure_we_got_to_the_end_of_it`
133133
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
134134

135135
error: item in documentation is missing backticks
136-
--> tests/ui/doc/doc-fixable.rs:78:5
136+
--> tests/ui/doc/doc-fixable.rs:79:5
137137
|
138138
LL | /// be_sure_we_got_to_the_end_of_it
139139
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -144,7 +144,7 @@ LL | /// `be_sure_we_got_to_the_end_of_it`
144144
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
145145

146146
error: item in documentation is missing backticks
147-
--> tests/ui/doc/doc-fixable.rs:95:5
147+
--> tests/ui/doc/doc-fixable.rs:96:5
148148
|
149149
LL | /// be_sure_we_got_to_the_end_of_it
150150
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -155,7 +155,7 @@ LL | /// `be_sure_we_got_to_the_end_of_it`
155155
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
156156

157157
error: item in documentation is missing backticks
158-
--> tests/ui/doc/doc-fixable.rs:103:8
158+
--> tests/ui/doc/doc-fixable.rs:104:8
159159
|
160160
LL | /// ## CamelCaseThing
161161
| ^^^^^^^^^^^^^^
@@ -166,7 +166,7 @@ LL | /// ## `CamelCaseThing`
166166
| ~~~~~~~~~~~~~~~~
167167

168168
error: item in documentation is missing backticks
169-
--> tests/ui/doc/doc-fixable.rs:106:7
169+
--> tests/ui/doc/doc-fixable.rs:107:7
170170
|
171171
LL | /// # CamelCaseThing
172172
| ^^^^^^^^^^^^^^
@@ -177,7 +177,7 @@ LL | /// # `CamelCaseThing`
177177
| ~~~~~~~~~~~~~~~~
178178

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

190190
error: item in documentation is missing backticks
191-
--> tests/ui/doc/doc-fixable.rs:109:5
191+
--> tests/ui/doc/doc-fixable.rs:110:5
192192
|
193193
LL | /// be_sure_we_got_to_the_end_of_it
194194
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -199,7 +199,7 @@ LL | /// `be_sure_we_got_to_the_end_of_it`
199199
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
200200

201201
error: item in documentation is missing backticks
202-
--> tests/ui/doc/doc-fixable.rs:116:5
202+
--> tests/ui/doc/doc-fixable.rs:117:5
203203
|
204204
LL | /// be_sure_we_got_to_the_end_of_it
205205
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -210,7 +210,7 @@ LL | /// `be_sure_we_got_to_the_end_of_it`
210210
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
211211

212212
error: item in documentation is missing backticks
213-
--> tests/ui/doc/doc-fixable.rs:129:5
213+
--> tests/ui/doc/doc-fixable.rs:130:5
214214
|
215215
LL | /// be_sure_we_got_to_the_end_of_it
216216
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -221,7 +221,7 @@ LL | /// `be_sure_we_got_to_the_end_of_it`
221221
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
222222

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

234234
error: item in documentation is missing backticks
235-
--> tests/ui/doc/doc-fixable.rs:145:5
235+
--> tests/ui/doc/doc-fixable.rs:146:5
236236
|
237237
LL | And BarQuz too.
238238
| ^^^^^^
@@ -243,7 +243,7 @@ LL | And `BarQuz` too.
243243
| ~~~~~~~~
244244

245245
error: item in documentation is missing backticks
246-
--> tests/ui/doc/doc-fixable.rs:146:1
246+
--> tests/ui/doc/doc-fixable.rs:147:1
247247
|
248248
LL | be_sure_we_got_to_the_end_of_it
249249
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -254,7 +254,7 @@ LL | `be_sure_we_got_to_the_end_of_it`
254254
|
255255

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

267267
error: item in documentation is missing backticks
268-
--> tests/ui/doc/doc-fixable.rs:156:5
268+
--> tests/ui/doc/doc-fixable.rs:157:5
269269
|
270270
LL | And BarQuz too.
271271
| ^^^^^^
@@ -276,7 +276,7 @@ LL | And `BarQuz` too.
276276
| ~~~~~~~~
277277

278278
error: item in documentation is missing backticks
279-
--> tests/ui/doc/doc-fixable.rs:157:1
279+
--> tests/ui/doc/doc-fixable.rs:158:1
280280
|
281281
LL | be_sure_we_got_to_the_end_of_it
282282
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -287,7 +287,7 @@ LL | `be_sure_we_got_to_the_end_of_it`
287287
|
288288

289289
error: item in documentation is missing backticks
290-
--> tests/ui/doc/doc-fixable.rs:168:5
290+
--> tests/ui/doc/doc-fixable.rs:169:5
291291
|
292292
LL | /// be_sure_we_got_to_the_end_of_it
293293
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -298,7 +298,7 @@ LL | /// `be_sure_we_got_to_the_end_of_it`
298298
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
299299

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

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

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

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

344344
error: item in documentation is missing backticks
345-
--> tests/ui/doc/doc-fixable.rs:237:5
345+
--> tests/ui/doc/doc-fixable.rs:238:5
346346
|
347347
LL | /// ABes
348348
| ^^^^
@@ -353,7 +353,7 @@ LL | /// `ABes`
353353
| ~~~~~~
354354

355355
error: item in documentation is missing backticks
356-
--> tests/ui/doc/doc-fixable.rs:243:9
356+
--> tests/ui/doc/doc-fixable.rs:244:9
357357
|
358358
LL | /// foo()
359359
| ^^^^^
@@ -364,7 +364,7 @@ LL | /// `foo()`
364364
| ~~~~~~~
365365

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

0 commit comments

Comments
 (0)