Skip to content

Commit

Permalink
github/workflows: Add GitHub Action to lint Python code with ruff.
Browse files Browse the repository at this point in the history
Signed-off-by: Damien George <damien@micropython.org>
  • Loading branch information
cclauss authored and dpgeorge committed May 2, 2023
1 parent 2a1db77 commit 78a1aa1
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/ruff.yml
@@ -0,0 +1,10 @@
# https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Python code lint with ruff
on: [push, pull_request]
jobs:
ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: pip install --user ruff
- run: ruff --format=github .
24 changes: 24 additions & 0 deletions pyproject.toml
Expand Up @@ -22,3 +22,27 @@ skip = """
./tests,\
ACKNOWLEDGEMENTS,\
"""

[tool.ruff]
exclude = ["lib", "tests"]
extend-select = ["C9", "PLC"]
ignore = [
"E401",
"E402",
"E722",
"E731",
"E741",
"F401",
"F403",
"F405",
"F821",
"PLC1901",
]
line-length = 337
target-version = "py37"

[tool.ruff.mccabe]
max-complexity = 40

[tool.ruff.per-file-ignores]
"ports/cc3200/tools/uniflash.py" = ["E711"]

0 comments on commit 78a1aa1

Please sign in to comment.