Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 6ce61d5

Browse files
committed
add missing configuration tests
1 parent ddbe110 commit 6ce61d5

File tree

61 files changed

+501
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+501
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
literal-representation-threshold = 0xFFFFFF
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#![warn(clippy::decimal_literal_representation)]
2+
fn main() {
3+
let _ = 8388608;
4+
let _ = 0x00FF_FFFF;
5+
//~^ ERROR: integer literal has a better hexadecimal representation
6+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#![warn(clippy::decimal_literal_representation)]
2+
fn main() {
3+
let _ = 8388608;
4+
let _ = 16777215;
5+
//~^ ERROR: integer literal has a better hexadecimal representation
6+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
error: integer literal has a better hexadecimal representation
2+
--> $DIR/decimal_literal_representation.rs:4:13
3+
|
4+
LL | let _ = 16777215;
5+
| ^^^^^^^^ help: consider: `0x00FF_FFFF`
6+
|
7+
= note: `-D clippy::decimal-literal-representation` implied by `-D warnings`
8+
= help: to override `-D warnings` add `#[allow(clippy::decimal_literal_representation)]`
9+
10+
error: aborting due to previous error
11+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
allowed-scripts = ["Cyrillic"]
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#![warn(clippy::disallowed_script_idents)]
2+
fn main() {
3+
let счётчик = 10;
4+
let カウンタ = 10;
5+
//~^ ERROR: identifier `カウンタ` has a Unicode script that is not allowed by configuration
6+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
error: identifier `カウンタ` has a Unicode script that is not allowed by configuration: Katakana
2+
--> $DIR/disallowed_script_idents.rs:4:9
3+
|
4+
LL | let カウンタ = 10;
5+
| ^^^^^^^^
6+
|
7+
= note: `-D clippy::disallowed-script-idents` implied by `-D warnings`
8+
= help: to override `-D warnings` add `#[allow(clippy::disallowed_script_idents)]`
9+
10+
error: aborting due to previous error
11+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
enum-variant-name-threshold = 5
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
enum Foo {
2+
AFoo,
3+
BFoo,
4+
CFoo,
5+
DFoo,
6+
}
7+
enum Foo2 {
8+
//~^ ERROR: all variants have the same postfix
9+
AFoo,
10+
BFoo,
11+
CFoo,
12+
DFoo,
13+
EFoo,
14+
}
15+
16+
fn main() {}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
error: all variants have the same postfix: `Foo`
2+
--> $DIR/enum_variant_names.rs:7:1
3+
|
4+
LL | / enum Foo2 {
5+
LL | |
6+
LL | | AFoo,
7+
LL | | BFoo,
8+
... |
9+
LL | | EFoo,
10+
LL | | }
11+
| |_^
12+
|
13+
= help: remove the postfixes and use full paths to the variants instead of glob imports
14+
= note: `-D clippy::enum-variant-names` implied by `-D warnings`
15+
= help: to override `-D warnings` add `#[allow(clippy::enum_variant_names)]`
16+
17+
error: aborting due to previous error
18+

0 commit comments

Comments
 (0)