Skip to content

Commit

Permalink
Merge pull request #88 from elliot-100/87-use-ruff-format-instead-of-…
Browse files Browse the repository at this point in the history
…isort-+-black-for-format-linting-inc-ci

Use ruff format instead of isort + black for format linting, inc. CI
  • Loading branch information
elliot-100 authored Jul 4, 2024
2 parents f18ab9a + f5864ec commit 50a0dee
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
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

0 comments on commit 50a0dee

Please sign in to comment.