Skip to content

Commit

Permalink
Add ruff config
Browse files Browse the repository at this point in the history
  • Loading branch information
parejkoj committed Jun 28, 2024
1 parent 5d65658 commit 1d445c4
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,8 @@ on:
pull_request:

jobs:
call-workflow:
uses: lsst/rubin_workflows/.github/workflows/lint.yaml@main
ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: chartboost/ruff-action@v1
7 changes: 7 additions & 0 deletions config/.ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
extend = "../pyproject.toml"
# Ignore undefined "config", as config files are loaded with `eval`.
builtins = ["config"]

[pycodestyle]
# Allow longer docstrings in configs, to better match the long single-lines.
max-doc-length = 110
35 changes: 35 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[tool.ruff]
line-length = 110
target-version = "py311"
exclude = [
"__init__.py",
"tests/config",
]

[tool.ruff.lint]
ignore = [
"N802",
"N803",
"N806",
"N812",
"N813",
"N815",
"N816",
"N999",
]
select = [
"E", # pycodestyle
"F", # pyflakes
"N", # pep8-naming
"W", # pycodestyle
]
extend-select = [
"RUF100", # Warn about unused noqa
]

[tool.ruff.lint.pycodestyle]
max-doc-length = 79

[tool.ruff.lint.pydocstyle]
convention = "numpy"

0 comments on commit 1d445c4

Please sign in to comment.