Skip to content

Commit

Permalink
Set up linting with ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
akx committed Aug 26, 2024
1 parent c5dd720 commit ea140d3
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 3 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ jobs:
- name: Test with pytest
run: pytest -v --cov .
- uses: codecov/codecov-action@v4
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- uses: pre-commit/[email protected]
build:
runs-on: ubuntu-latest
steps:
Expand Down
17 changes: 17 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
minimum_pre_commit_version: 2.15.0
ci:
autofix_prs: false
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.2
hooks:
- id: ruff
args:
- --fix
- id: ruff-format
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: debug-statements
- id: end-of-file-fixer
- id: trailing-whitespace
20 changes: 17 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ dependencies = [

[project.optional-dependencies]
dev = [
"flake8",
"isort",
"pydocstyle",
"pytest",
"pytest-cov",
]
Expand All @@ -39,3 +36,20 @@ path = "oidckit/__init__.py"
include = [
"/oidckit",
]

[tool.ruff.lint]
ignore = [
"E501",
]
select = [
"B",
"COM",
"E",
"F",
"I",
"TID",
"W",
]

[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "all"

0 comments on commit ea140d3

Please sign in to comment.