Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace isort with ruff #153

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ disable=
too-many-public-methods,
missing-class-docstring,
superfluous-parens,
multiple-imports, # We're using isort to lint imports
ungrouped-imports, # We're using isort to lint imports
wrong-import-order, # We're using isort to lint imports
wrong-import-position # We're using isort to lint imports
multiple-imports, # We're using ruff to lint imports
ungrouped-imports, # We're using ruff to lint imports
wrong-import-order, # We're using ruff to lint imports
wrong-import-position # We're using ruff to lint imports

[REPORTS]

Expand Down
18 changes: 18 additions & 0 deletions .ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
src = ["app"]

select = [
"I", # Enable isort rules.
]
ignore = []

exclude = [
".git",
"third_party",
"venv",
]

# Assume Python 3.9
target-version = "py39"

[isort]
force-single-line = true
1 change: 1 addition & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"recommendations": [
"charliermarsh.ruff",
"ms-python.python",
"esbenp.prettier-vscode",
"eeyore.yapf",
Expand Down
10 changes: 3 additions & 7 deletions dev-scripts/build-python
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,9 @@ coverage report
# Check that source has correct formatting.
yapf --diff --recursive ./

# Check correct sorting for imports.
isort \
. \
--force-single-line-imports \
--diff \
--check-only \
--skip-glob="${VIRTUALENV_DIR}/*"
# Run static analysis for Python bugs/cruft.
ruff check \
"${SOURCE_DIR}/"

# Run static analysis for Python bugs/cruft.
pyflakes "${SOURCE_DIR}/"
Expand Down
2 changes: 1 addition & 1 deletion dev_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
coverage==7.3.3
isort[requirements_deprecated_finder]==5.13.2
pyflakes==3.1.0
pylint==2.15.2
ruff==0.1.8
yapf==0.40.2
-r requirements.txt