-
Notifications
You must be signed in to change notification settings - Fork 893
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes #2053.
- Loading branch information
Showing
22 changed files
with
555 additions
and
58 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
class MyClass: | ||
ImportError = 4 | ||
id = 5 | ||
dir = "/" | ||
|
||
def __init__(self): | ||
self.float = 5 # is fine | ||
self.id = 10 | ||
self.dir = "." | ||
|
||
def str(self): | ||
pass |
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
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,44 @@ | ||
//! Settings for the `flake8-builtins` plugin. | ||
|
||
use ruff_macros::ConfigurationOptions; | ||
use schemars::JsonSchema; | ||
use serde::{Deserialize, Serialize}; | ||
|
||
#[derive( | ||
Debug, PartialEq, Eq, Default, Serialize, Deserialize, ConfigurationOptions, JsonSchema, | ||
)] | ||
#[serde( | ||
deny_unknown_fields, | ||
rename_all = "kebab-case", | ||
rename = "Flake8BuiltinsOptions" | ||
)] | ||
pub struct Options { | ||
#[option( | ||
default = r#"[]"#, | ||
value_type = "Vec<String>", | ||
example = "builtins-ignorelist = [\"id\"]" | ||
)] | ||
/// Ignore list of builtins. | ||
pub builtins_ignorelist: Option<Vec<String>>, | ||
} | ||
|
||
#[derive(Debug, Default, Hash)] | ||
pub struct Settings { | ||
pub builtins_ignorelist: Vec<String>, | ||
} | ||
|
||
impl From<Options> for Settings { | ||
fn from(options: Options) -> Self { | ||
Self { | ||
builtins_ignorelist: options.builtins_ignorelist.unwrap_or_default(), | ||
} | ||
} | ||
} | ||
|
||
impl From<Settings> for Options { | ||
fn from(settings: Settings) -> Self { | ||
Self { | ||
builtins_ignorelist: Some(settings.builtins_ignorelist), | ||
} | ||
} | ||
} |
Oops, something went wrong.