Skip to content

Commit

Permalink
use ruff linter with pre-commit hook and in github actions (#109)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidwilby committed Apr 26, 2024
1 parent 125fb25 commit 3a1ff52
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 7 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Black
- name: Install Ruff
run: |
python -m pip install --upgrade pip
pip install black
pip install ruff
- name: Check style
run: |
black --check *.py deepsensor tests
ruff check
9 changes: 9 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.4.2
hooks:
# Run the linter.
- id: ruff
# Run the formatter.
- id: ruff-format
8 changes: 7 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,10 @@ warn_redundant_casts = true
warn_return_any = true
warn_unreachable = true
warn_unused_configs = true
no_implicit_reexport = true
no_implicit_reexport = true

[tool.ruff.lint]
select = ["D"]

[tool.ruff.lint.pydocstyle]
convention = "google"
7 changes: 4 additions & 3 deletions requirements/requirements.dev.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Additional requirements for development
coveralls
parameterized
pre-commit
pytest
pytest-cov
parameterized
ruff
tox
tox-gh-actions
coveralls
black

0 comments on commit 3a1ff52

Please sign in to comment.