mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-04 18:58:04 +00:00
29 lines
871 B
Rust
29 lines
871 B
Rust
//! Rules from [eradicate](https://pypi.org/project/eradicate/2.1.0/).
|
|
pub(crate) mod detection;
|
|
pub(crate) mod rules;
|
|
|
|
#[cfg(test)]
|
|
mod tests {
|
|
use std::convert::AsRef;
|
|
use std::path::Path;
|
|
|
|
use anyhow::Result;
|
|
use test_case::test_case;
|
|
|
|
use crate::linter::test_path;
|
|
use crate::registry::RuleCode;
|
|
use crate::settings;
|
|
|
|
#[test_case(RuleCode::ERA001, Path::new("ERA001.py"); "ERA001")]
|
|
fn rules(rule_code: RuleCode, path: &Path) -> Result<()> {
|
|
let snapshot = format!("{}_{}", rule_code.as_ref(), path.to_string_lossy());
|
|
let diagnostics = test_path(
|
|
Path::new("./resources/test/fixtures/eradicate")
|
|
.join(path)
|
|
.as_path(),
|
|
&settings::Settings::for_rule(rule_code),
|
|
)?;
|
|
insta::assert_yaml_snapshot!(snapshot, diagnostics);
|
|
Ok(())
|
|
}
|
|
}
|