mirror of https://github.com/astral-sh/ruff
refactor: run `clippy --fix`
Fix the following - https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow - https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten
This commit is contained in:
parent
26e1f4b6df
commit
00ee60ea8d
|
|
@ -68,7 +68,7 @@ mod tests {
|
||||||
#[test]
|
#[test]
|
||||||
fn e501() -> Result<()> {
|
fn e501() -> Result<()> {
|
||||||
let actual = check_path(
|
let actual = check_path(
|
||||||
&Path::new("./resources/test/src/E501.py"),
|
Path::new("./resources/test/src/E501.py"),
|
||||||
&settings::Settings {
|
&settings::Settings {
|
||||||
line_length: 88,
|
line_length: 88,
|
||||||
exclude: vec![],
|
exclude: vec![],
|
||||||
|
|
@ -92,7 +92,7 @@ mod tests {
|
||||||
#[test]
|
#[test]
|
||||||
fn f401() -> Result<()> {
|
fn f401() -> Result<()> {
|
||||||
let actual = check_path(
|
let actual = check_path(
|
||||||
&Path::new("./resources/test/src/F401.py"),
|
Path::new("./resources/test/src/F401.py"),
|
||||||
&settings::Settings {
|
&settings::Settings {
|
||||||
line_length: 88,
|
line_length: 88,
|
||||||
exclude: vec![],
|
exclude: vec![],
|
||||||
|
|
@ -128,7 +128,7 @@ mod tests {
|
||||||
#[test]
|
#[test]
|
||||||
fn f403() -> Result<()> {
|
fn f403() -> Result<()> {
|
||||||
let actual = check_path(
|
let actual = check_path(
|
||||||
&Path::new("./resources/test/src/F403.py"),
|
Path::new("./resources/test/src/F403.py"),
|
||||||
&settings::Settings {
|
&settings::Settings {
|
||||||
line_length: 88,
|
line_length: 88,
|
||||||
exclude: vec![],
|
exclude: vec![],
|
||||||
|
|
@ -158,7 +158,7 @@ mod tests {
|
||||||
#[test]
|
#[test]
|
||||||
fn f541() -> Result<()> {
|
fn f541() -> Result<()> {
|
||||||
let actual = check_path(
|
let actual = check_path(
|
||||||
&Path::new("./resources/test/src/F541.py"),
|
Path::new("./resources/test/src/F541.py"),
|
||||||
&settings::Settings {
|
&settings::Settings {
|
||||||
line_length: 88,
|
line_length: 88,
|
||||||
exclude: vec![],
|
exclude: vec![],
|
||||||
|
|
@ -194,7 +194,7 @@ mod tests {
|
||||||
#[test]
|
#[test]
|
||||||
fn f634() -> Result<()> {
|
fn f634() -> Result<()> {
|
||||||
let actual = check_path(
|
let actual = check_path(
|
||||||
&Path::new("./resources/test/src/F634.py"),
|
Path::new("./resources/test/src/F634.py"),
|
||||||
&settings::Settings {
|
&settings::Settings {
|
||||||
line_length: 88,
|
line_length: 88,
|
||||||
exclude: vec![],
|
exclude: vec![],
|
||||||
|
|
@ -225,7 +225,7 @@ mod tests {
|
||||||
#[test]
|
#[test]
|
||||||
fn f704() -> Result<()> {
|
fn f704() -> Result<()> {
|
||||||
let actual = check_path(
|
let actual = check_path(
|
||||||
&Path::new("./resources/test/src/F704.py"),
|
Path::new("./resources/test/src/F704.py"),
|
||||||
&settings::Settings {
|
&settings::Settings {
|
||||||
line_length: 88,
|
line_length: 88,
|
||||||
exclude: vec![],
|
exclude: vec![],
|
||||||
|
|
@ -261,7 +261,7 @@ mod tests {
|
||||||
#[test]
|
#[test]
|
||||||
fn f706() -> Result<()> {
|
fn f706() -> Result<()> {
|
||||||
let actual = check_path(
|
let actual = check_path(
|
||||||
&Path::new("./resources/test/src/F706.py"),
|
Path::new("./resources/test/src/F706.py"),
|
||||||
&settings::Settings {
|
&settings::Settings {
|
||||||
line_length: 88,
|
line_length: 88,
|
||||||
exclude: vec![],
|
exclude: vec![],
|
||||||
|
|
@ -292,7 +292,7 @@ mod tests {
|
||||||
#[test]
|
#[test]
|
||||||
fn f821() -> Result<()> {
|
fn f821() -> Result<()> {
|
||||||
let actual = check_path(
|
let actual = check_path(
|
||||||
&Path::new("./resources/test/src/F821.py"),
|
Path::new("./resources/test/src/F821.py"),
|
||||||
&settings::Settings {
|
&settings::Settings {
|
||||||
line_length: 88,
|
line_length: 88,
|
||||||
exclude: vec![],
|
exclude: vec![],
|
||||||
|
|
@ -333,7 +333,7 @@ mod tests {
|
||||||
#[test]
|
#[test]
|
||||||
fn f831() -> Result<()> {
|
fn f831() -> Result<()> {
|
||||||
let actual = check_path(
|
let actual = check_path(
|
||||||
&Path::new("./resources/test/src/F831.py"),
|
Path::new("./resources/test/src/F831.py"),
|
||||||
&settings::Settings {
|
&settings::Settings {
|
||||||
line_length: 88,
|
line_length: 88,
|
||||||
exclude: vec![],
|
exclude: vec![],
|
||||||
|
|
@ -369,7 +369,7 @@ mod tests {
|
||||||
#[test]
|
#[test]
|
||||||
fn f823() -> Result<()> {
|
fn f823() -> Result<()> {
|
||||||
let actual = check_path(
|
let actual = check_path(
|
||||||
&Path::new("./resources/test/src/F823.py"),
|
Path::new("./resources/test/src/F823.py"),
|
||||||
&settings::Settings {
|
&settings::Settings {
|
||||||
line_length: 88,
|
line_length: 88,
|
||||||
exclude: vec![],
|
exclude: vec![],
|
||||||
|
|
@ -393,7 +393,7 @@ mod tests {
|
||||||
#[test]
|
#[test]
|
||||||
fn f841() -> Result<()> {
|
fn f841() -> Result<()> {
|
||||||
let actual = check_path(
|
let actual = check_path(
|
||||||
&Path::new("./resources/test/src/F841.py"),
|
Path::new("./resources/test/src/F841.py"),
|
||||||
&settings::Settings {
|
&settings::Settings {
|
||||||
line_length: 88,
|
line_length: 88,
|
||||||
exclude: vec![],
|
exclude: vec![],
|
||||||
|
|
@ -424,7 +424,7 @@ mod tests {
|
||||||
#[test]
|
#[test]
|
||||||
fn f901() -> Result<()> {
|
fn f901() -> Result<()> {
|
||||||
let actual = check_path(
|
let actual = check_path(
|
||||||
&Path::new("./resources/test/src/F901.py"),
|
Path::new("./resources/test/src/F901.py"),
|
||||||
&settings::Settings {
|
&settings::Settings {
|
||||||
line_length: 88,
|
line_length: 88,
|
||||||
exclude: vec![],
|
exclude: vec![],
|
||||||
|
|
|
||||||
|
|
@ -226,8 +226,7 @@ other-attribute = 1
|
||||||
let pyproject = parse_pyproject_toml(&path)?;
|
let pyproject = parse_pyproject_toml(&path)?;
|
||||||
let config = pyproject
|
let config = pyproject
|
||||||
.tool
|
.tool
|
||||||
.map(|tool| tool.ruff)
|
.and_then(|tool| tool.ruff)
|
||||||
.flatten()
|
|
||||||
.expect("Unable to find tool.ruff.");
|
.expect("Unable to find tool.ruff.");
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
config,
|
config,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue