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

Use ruff format instead of isort + black for format linting, inc. CI #88

Merged
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
11 changes: 5 additions & 6 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,11 @@ jobs:
virtualenvs-in-project: true
- name: Install project
run: poetry install --without dev # installs main and test groups
- name: Lint with isort
# by default: exit with error if imports are not properly sorted; show diffs
uses: isort/isort-action@master
- name: Lint with black
# by default: exit with error if code is not properly formatted; show diffs
uses: psf/black@stable
- name: Lint format with ruff
# by default: exit with error if rule violations
uses: chartboost/ruff-action@v1
with:
args: format
- name: Lint with ruff
# by default: exit with error if rule violations
uses: chartboost/ruff-action@v1
Expand Down
12 changes: 6 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ requests = "^2.23.1"
playwright = "^1.39.0"

[tool.poetry.group.dev.dependencies]
black = "^24.4.0"
isort = "^5.13.0"
ruff = "^0.4.1"

[tool.poetry.group.test.dependencies]
Expand All @@ -43,13 +41,15 @@ disallow_untyped_calls = false

[tool.ruff]
# Enable rulesets:
# flake8-ANNotations, flake8-COMmas, pyDocstyle, pycodestylE, pyFlakes,
# flake8-ANNotations, flake8-COMmas, pyDocstyle, pycodestylE, pyFlakes, Isort,
# flake8-Future-Annotations, flake8-bandit (S)
select = ["ANN", "COM", "D", "E", "F", "FA", "S"]
select = ["ANN", "COM", "D", "E", "F", "I", "FA", "S"]

# Ignore rules:
# Ignore rules that conflict with Ruff formatter:
# COM812 Trailing comma missing
# Ignore other rules:
# Missing type annotation for `self` in method
ignore = ["ANN101"]
ignore = ["COM812", "ANN101"]

[tool.ruff.per-file-ignores]
# Use of `assert` detected
Expand Down