mirror of
https://github.com/neondatabase/neon.git
synced 2025-12-22 21:59:59 +00:00
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:
committed by
GitHub
parent
68ae020b37
commit
3d869cbcde
@@ -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,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user