Implement D407, D408, D409, D412, and D414 (#413)

This commit is contained in:
Charlie Marsh 2022-10-12 17:12:54 -04:00 committed by GitHub
parent f0dab24079
commit 167992ad48
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 414 additions and 30 deletions

View file

@ -1320,6 +1320,42 @@ mod tests {
Ok(())
}
#[test]
fn d407() -> Result<()> {
let mut checks = check_path(
Path::new("./resources/test/fixtures/sections.py"),
&settings::Settings::for_rule(CheckCode::D407),
&fixer::Mode::Generate,
)?;
checks.sort_by_key(|check| check.location);
insta::assert_yaml_snapshot!(checks);
Ok(())
}
#[test]
fn d408() -> Result<()> {
let mut checks = check_path(
Path::new("./resources/test/fixtures/sections.py"),
&settings::Settings::for_rule(CheckCode::D408),
&fixer::Mode::Generate,
)?;
checks.sort_by_key(|check| check.location);
insta::assert_yaml_snapshot!(checks);
Ok(())
}
#[test]
fn d409() -> Result<()> {
let mut checks = check_path(
Path::new("./resources/test/fixtures/sections.py"),
&settings::Settings::for_rule(CheckCode::D409),
&fixer::Mode::Generate,
)?;
checks.sort_by_key(|check| check.location);
insta::assert_yaml_snapshot!(checks);
Ok(())
}
#[test]
fn d410() -> Result<()> {
let mut checks = check_path(
@ -1344,6 +1380,18 @@ mod tests {
Ok(())
}
#[test]
fn d412() -> Result<()> {
let mut checks = check_path(
Path::new("./resources/test/fixtures/sections.py"),
&settings::Settings::for_rule(CheckCode::D412),
&fixer::Mode::Generate,
)?;
checks.sort_by_key(|check| check.location);
insta::assert_yaml_snapshot!(checks);
Ok(())
}
#[test]
fn d413() -> Result<()> {
let mut checks = check_path(
@ -1356,6 +1404,18 @@ mod tests {
Ok(())
}
#[test]
fn d414() -> Result<()> {
let mut checks = check_path(
Path::new("./resources/test/fixtures/sections.py"),
&settings::Settings::for_rule(CheckCode::D414),
&fixer::Mode::Generate,
)?;
checks.sort_by_key(|check| check.location);
insta::assert_yaml_snapshot!(checks);
Ok(())
}
#[test]
fn d415() -> Result<()> {
let mut checks = check_path(