Skip to content

Commit 38519de

Browse files
committed
use ruff as a linter
1 parent 0e89eb4 commit 38519de

File tree

3 files changed

+17
-8
lines changed

3 files changed

+17
-8
lines changed

.github/workflows/lint.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,16 @@ jobs:
2424
- name: Install dependencies
2525
run: |
2626
pip install --upgrade pip setuptools wheel
27-
pip install flake8==4.0.1
28-
pip install --upgrade isort blue mypy types-PyYAML bandit safety
27+
pip install --upgrade isort blue mypy ruff bandit safety
2928
3029
- name: Run lint
3130
run: isort .
3231

3332
- name: Run blue formatter
3433
run: make format
3534

36-
- name: Run flake8
37-
run: |
38-
flake8 . --count --show-source --statistics
39-
flake8 . --count --exit-zero --max-complexity=4
35+
- name: Run ruff
36+
run: ruff .
4037

4138
- name: Run mypy / static types
4239
run: make static-check

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ format: isort ## formats python
7272
@blue .
7373

7474
lint: format ## run python flake8 linter tool
75-
@flake8 --exclude .git,.venv pygithubactions
75+
@ruff .
7676

7777
static-check: ## runs static checks with mypy
7878
@mypy pygithubactions

pyproject.toml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[project]
22

33
name = "pygithubactions"
4-
version = "0.1.0"
4+
version = "0.1.0"
55
description = "Github actions core library implemented in python"
66
readme = "README.md"
77
requires-python = ">=3.10"
@@ -46,3 +46,15 @@ multi_line_output = 3
4646

4747
[tool.mypy]
4848
ignore_missing_imports = true
49+
50+
[tool.ruff]
51+
select = [
52+
"E", # pycodestyle errors
53+
"W", # pycodestyle warnings
54+
"F", # pyflakes
55+
"C", # flake8-comprehensions
56+
"B", # flake8-bugbear
57+
]
58+
59+
[tool.ruff.per-file-ignores]
60+
"__init__.py" = ["F401"]

0 commit comments

Comments
 (0)