Skip to content

Commit fbd1c76

Browse files
committed
Set up linting with ruff
1 parent e86acbc commit fbd1c76

File tree

3 files changed

+42
-3
lines changed

3 files changed

+42
-3
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@ jobs:
2525
- name: Test with pytest
2626
run: pytest -v --cov .
2727
- uses: codecov/codecov-action@v4
28+
lint:
29+
runs-on: ubuntu-latest
30+
steps:
31+
- uses: actions/checkout@v4
32+
- uses: actions/setup-python@v5
33+
with:
34+
python-version: "3.12"
35+
- uses: pre-commit/[email protected]
2836
build:
2937
runs-on: ubuntu-latest
3038
steps:

.pre-commit-config.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
minimum_pre_commit_version: 2.15.0
2+
ci:
3+
autofix_prs: false
4+
repos:
5+
- repo: https://github.com/astral-sh/ruff-pre-commit
6+
rev: v0.6.2
7+
hooks:
8+
- id: ruff
9+
args:
10+
- --fix
11+
- id: ruff-format
12+
- repo: https://github.com/pre-commit/pre-commit-hooks
13+
rev: v4.6.0
14+
hooks:
15+
- id: debug-statements
16+
- id: end-of-file-fixer
17+
- id: trailing-whitespace

pyproject.toml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ dependencies = [
2222

2323
[project.optional-dependencies]
2424
dev = [
25-
"flake8",
26-
"isort",
27-
"pydocstyle",
2825
"pytest",
2926
"pytest-cov",
3027
]
@@ -39,3 +36,20 @@ path = "oidckit/__init__.py"
3936
include = [
4037
"/oidckit",
4138
]
39+
40+
[tool.ruff.lint]
41+
ignore = [
42+
"E501",
43+
]
44+
select = [
45+
"B",
46+
"COM",
47+
"E",
48+
"F",
49+
"I",
50+
"TID",
51+
"W",
52+
]
53+
54+
[tool.ruff.lint.flake8-tidy-imports]
55+
ban-relative-imports = "all"

0 commit comments

Comments
 (0)