Replace flake8 and isort with ruff (#3810)

- Introduce ruff (https://beta.ruff.rs/) to replace flake8 and isort
- Update mypy and black
This commit is contained in:
Alexander Bayandin
2023-03-14 14:25:44 +01:00
committed by GitHub
parent 68ae020b37
commit 3d869cbcde
39 changed files with 177 additions and 249 deletions

View File

@@ -43,17 +43,13 @@ def black(fix_inplace: bool) -> str:
return cmd
def isort(fix_inplace: bool) -> str:
cmd = "poetry run isort"
if not fix_inplace:
cmd += " --diff --check"
def ruff(fix_inplace: bool) -> str:
cmd = "poetry run ruff"
if fix_inplace:
cmd += " --fix"
return cmd
def flake8() -> str:
return "poetry run flake8"
def mypy() -> str:
return "poetry run mypy"
@@ -112,13 +108,6 @@ if __name__ == "__main__":
changed_files=files,
no_color=args.no_color,
)
check(
name="isort",
suffix=".py",
cmd=isort(fix_inplace=args.fix_inplace),
changed_files=files,
no_color=args.no_color,
)
check(
name="black",
suffix=".py",
@@ -127,9 +116,9 @@ if __name__ == "__main__":
no_color=args.no_color,
)
check(
name="flake8",
name="ruff",
suffix=".py",
cmd=flake8(),
cmd=ruff(fix_inplace=args.fix_inplace),
changed_files=files,
no_color=args.no_color,
)