Skip to content

Commit

Permalink
Merge pull request #218 from DimitriPapadopoulos/ruff_toml
Browse files Browse the repository at this point in the history
Enforce ruff rules
  • Loading branch information
sbesson authored Feb 25, 2025
2 parents 2bf487f + 8f3594f commit accccf2
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
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
]

0 comments on commit accccf2

Please sign in to comment.