mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-04 10:48:32 +00:00
Rename checks
and plugins
to rules
(#1739)
This commit is contained in:
parent
caf6c65de7
commit
59155ce9f6
195 changed files with 1132 additions and 1192 deletions
|
@ -31,10 +31,10 @@ def main(*, plugin: str, url: str) -> None:
|
|||
|
||||
# Create the Rust module.
|
||||
os.makedirs(os.path.join(ROOT_DIR, f"src/{dir_name(plugin)}"), exist_ok=True)
|
||||
with open(os.path.join(ROOT_DIR, f"src/{dir_name(plugin)}/plugins.rs"), "a"):
|
||||
with open(os.path.join(ROOT_DIR, f"src/{dir_name(plugin)}/rules"), "a"):
|
||||
pass
|
||||
with open(os.path.join(ROOT_DIR, f"src/{dir_name(plugin)}/mod.rs"), "w+") as fp:
|
||||
fp.write("pub mod plugins;\n")
|
||||
with open(os.path.join(ROOT_DIR, f"src/{dir_name(plugin)}/rules"), "w+") as fp:
|
||||
fp.write("pub mod rules;\n")
|
||||
fp.write("\n")
|
||||
fp.write(
|
||||
"""#[cfg(test)]
|
||||
|
@ -49,7 +49,7 @@ mod tests {
|
|||
use crate::linter::test_path;
|
||||
use crate::settings;
|
||||
|
||||
fn diagnostics(check_code: RuleCode, path: &Path) -> Result<()> {
|
||||
fn rules(check_code: RuleCode, path: &Path) -> Result<()> {
|
||||
let snapshot = format!("{}_{}", check_code.as_ref(), path.to_string_lossy());
|
||||
let diagnostics =test_path(
|
||||
Path::new("./resources/test/fixtures/%s")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue