-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add configuration for [
wildcard_imports
] to ignore certain imports
- Loading branch information
Showing
8 changed files
with
78 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ignored-wildcard-imports = ["utils"] |
18 changes: 18 additions & 0 deletions
18
tests/ui-toml/wildcard_imports_whitelist/wildcard_imports.fixed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#![warn(clippy::wildcard_imports)] | ||
|
||
mod utils { | ||
pub fn print() {} | ||
} | ||
|
||
mod utils_plus { | ||
pub fn do_something() {} | ||
} | ||
|
||
use utils::*; | ||
use utils_plus::do_something; | ||
//~^ ERROR: usage of wildcard import | ||
|
||
fn main() { | ||
print(); | ||
do_something(); | ||
} |
18 changes: 18 additions & 0 deletions
18
tests/ui-toml/wildcard_imports_whitelist/wildcard_imports.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#![warn(clippy::wildcard_imports)] | ||
|
||
mod utils { | ||
pub fn print() {} | ||
} | ||
|
||
mod utils_plus { | ||
pub fn do_something() {} | ||
} | ||
|
||
use utils::*; | ||
use utils_plus::*; | ||
//~^ ERROR: usage of wildcard import | ||
|
||
fn main() { | ||
print(); | ||
do_something(); | ||
} |
11 changes: 11 additions & 0 deletions
11
tests/ui-toml/wildcard_imports_whitelist/wildcard_imports.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
error: usage of wildcard import | ||
--> $DIR/wildcard_imports.rs:12:5 | ||
| | ||
LL | use utils_plus::*; | ||
| ^^^^^^^^^^^^^ help: try: `utils_plus::do_something` | ||
| | ||
= note: `-D clippy::wildcard-imports` implied by `-D warnings` | ||
= help: to override `-D warnings` add `#[allow(clippy::wildcard_imports)]` | ||
|
||
error: aborting due to 1 previous error | ||
|