Skip to content

Commit

Permalink
Ruff tweaks (#178)
Browse files Browse the repository at this point in the history
* Use pyproject.toml for ruff config where possible

One less file to track, not strongly held opinion if
there are arguments against it

* Run ruff format before ruff check in precommit

That way any that can be fixed are checked before linting
  • Loading branch information
stefpiatek authored Dec 13, 2023
1 parent 44c9226 commit 763be0f
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 20 deletions.
4 changes: 1 addition & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,10 @@ repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.6
hooks:
- id: ruff-format
- id: ruff
args:
- --fix
- id: ruff-format
args:
- --config=ruff.toml

- repo: local
hooks:
Expand Down
7 changes: 7 additions & 0 deletions hasher/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,10 @@ dev = [
[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"

[tool.ruff]
extend = "../ruff.toml"

[tool.ruff.extend-per-file-ignores]
"./tests/**" = ["D1"]
"./src/hasher/endpoints.py" = ["D103"]
5 changes: 0 additions & 5 deletions hasher/ruff.toml

This file was deleted.

6 changes: 6 additions & 0 deletions pixl_core/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,9 @@ build-backend = "setuptools.build_meta"

[tool.pytest.ini_options]
markers = ["pika"]

[tool.ruff]
extend = "../ruff.toml"

[tool.ruff.extend-per-file-ignores]
"./tests/**" = ["D100"]
4 changes: 0 additions & 4 deletions pixl_core/ruff.toml

This file was deleted.

6 changes: 6 additions & 0 deletions pixl_ehr/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,11 @@ build-backend = "setuptools.build_meta"
[tool.pytest.ini_options]
markers = ["processing"]

[tool.ruff]
extend = "../ruff.toml"

[tool.ruff.extend-per-file-ignores]
"./tests/**" = ["D1"]

[tool.setuptools.package-data]
pixl_ehr = ["sql/*.sql", "report_deid/*.txt"]
4 changes: 0 additions & 4 deletions pixl_ehr/ruff.toml

This file was deleted.

6 changes: 6 additions & 0 deletions pixl_pacs/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,9 @@ build-backend = "setuptools.build_meta"

[tool.pytest.ini_options]
markers = ["processing"]

[tool.ruff]
extend = "../ruff.toml"

[tool.ruff.extend-per-file-ignores]
"./tests/**" = ["D1"]
4 changes: 0 additions & 4 deletions pixl_pacs/ruff.toml

This file was deleted.

0 comments on commit 763be0f

Please sign in to comment.