diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 48ab938..8d0a8e0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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/action@v3.0.1 build: runs-on: ubuntu-latest steps: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..77d4606 --- /dev/null +++ b/.pre-commit-config.yaml @@ -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 diff --git a/pyproject.toml b/pyproject.toml index af1ad99..11d2564 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,9 +22,6 @@ dependencies = [ [project.optional-dependencies] dev = [ - "flake8", - "isort", - "pydocstyle", "pytest", "pytest-cov", ] @@ -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"