Skip to content

Commit

Permalink
Lint with ruff and mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
aaltat committed Feb 1, 2025
1 parent 93e27eb commit 3c86f06
Show file tree
Hide file tree
Showing 8 changed files with 226 additions and 144 deletions.
14 changes: 5 additions & 9 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,14 @@ jobs:
- name: Install dependencies on Python
if: matrix.python-version != 'pypy3'
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
pip install robotframework==${{ matrix.rf-version }}
- name: Install dependencies on pypy3
if: matrix.python-version == 'pypy3'
run: |
python -m pip install --upgrade pip
pip install robotframework==${{ matrix.rf-version }}
python -m pip install --upgrade pip uv
uv pip install --python ${{ matrix.python-version }} --system -r requirements-dev.txt
uv pip install --python ${{ matrix.python-version }} --system robotframework==${{ matrix.rf-version }}
- name: Run lint
if: matrix.python-version != 'pypy3'
run: |
inv lint
env:
GITHUB_ACTIONS_RUNNIN_RUFF_LINT: 'true'
- name: Run tests
run: |
python --version
Expand Down
53 changes: 51 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,52 @@
[tool.black]
[tool.ruff]
exclude = [
"__pycache__",
".venv",
".git",
]
line-length = 100
target-version = ['py37']
lint.ignore = [
"T201", # Use print
"N818", # Exception name check is disabled
"PTH100", # abspath is OK
"B904", # Raise inside except block
"RET503", # Return statement in finally block
]
target-version = "py38"
lint.select = [
"E",
"F",
"W",
"C90",
"I",
"N",
"B",
"PYI",
"PL",
"PTH",
"UP",
"A",
"C4",
"DTZ",
"ISC",
"ICN",
"INP",
"PIE",
"T20",
"PYI",
"PT",
"RSE",
"RET",
"SIM",
"RUF"
]
[tool.ruff.lint.per-file-ignores]
"tasks.py" = [
"T201",
"PTH123",
"PTH120"
]

[[tool.mypy.overrides]]
module = ["robot.api.*"]
follow_untyped_imports = true
6 changes: 3 additions & 3 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ invoke >= 1.4.1
rellu >= 0.6
twine >= 3.4.1
wheel >= 0.36.2
black >= 21.9b0
flake8 >= 3.9.2
robotframework-tidy >= 1.6.1
isort >= 5.9.3
ruff >= 0.9.4
mypy >= 1.14.1
uv >= 0.5.26
Loading

0 comments on commit 3c86f06

Please sign in to comment.