Skip to content
New issue

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

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

Already on GitHub? # to your account

Enforce ruff rules #218

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
18 changes: 18 additions & 0 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Python linting

on:
pull_request:
branches:
- '*'

permissions:
contents: read

jobs:
ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/ruff-action@v3
- name: Lint with Ruff
run: ruff check --output-format=github
26 changes: 26 additions & 0 deletions .ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[lint]
extend-select = [
"W", # pycodestyle (Warning)
"I", # isort
"UP", # pyupgrade
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"ISC", # flake8-implicit-str-concat
"G", # flake8-logging-format
"PIE", # flake8-pie
"PYI", # flake8-pyi
"PERF", # Perflint
"FURB", # refurb
"RUF",
]
ignore = [
"UP015", # Unnecessary open mode parameters
"UP031", # Use format specifiers instead of percent format
"B903",
"B904",
"C408", # Unnecessary `list()`/`dict()` call (rewrite as a literal)
"G002", # Logging statement uses `%`
"G010", # Logging statement uses `warn` instead of `warning`
"FURB154", # Use of repeated consecutive `global`
"RUF031", # Avoid parentheses for tuples in subscripts
]