]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/src/docs/disallowed_script_idents.txt
Rollup merge of #101189 - daxpedda:ready-into-inner, r=joshtriplett
[rust.git] / src / tools / clippy / src / docs / disallowed_script_idents.txt
1 ### What it does
2 Checks for usage of unicode scripts other than those explicitly allowed
3 by the lint config.
4
5 This lint doesn't take into account non-text scripts such as `Unknown` and `Linear_A`.
6 It also ignores the `Common` script type.
7 While configuring, be sure to use official script name [aliases] from
8 [the list of supported scripts][supported_scripts].
9
10 See also: [`non_ascii_idents`].
11
12 [aliases]: http://www.unicode.org/reports/tr24/tr24-31.html#Script_Value_Aliases
13 [supported_scripts]: https://www.unicode.org/iso15924/iso15924-codes.html
14
15 ### Why is this bad?
16 It may be not desired to have many different scripts for
17 identifiers in the codebase.
18
19 Note that if you only want to allow plain English, you might want to use
20 built-in [`non_ascii_idents`] lint instead.
21
22 [`non_ascii_idents`]: https://doc.rust-lang.org/rustc/lints/listing/allowed-by-default.html#non-ascii-idents
23
24 ### Example
25 ```
26 // Assuming that `clippy.toml` contains the following line:
27 // allowed-locales = ["Latin", "Cyrillic"]
28 let counter = 10; // OK, latin is allowed.
29 let счётчик = 10; // OK, cyrillic is allowed.
30 let zähler = 10; // OK, it's still latin.
31 let カウンタ = 10; // Will spawn the lint.
32 ```