Skip to content

Commit

Permalink
enable pycodestyle and ruff tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gituser789 committed Feb 6, 2024
1 parent f230d1e commit 6cfb112
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@ jobs:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- name: check linting using pycodestyle
run: |
pip install pycodestyle
pip install pytest
pycodestyle $(git ls-files '*.py')
pip install ruff
ruff check $(git ls-files '*.py')
# Runs a single command using the runners shell
- name: install tdb package
run: |
Expand Down
31 changes: 31 additions & 0 deletions ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

exclude = [
".eggs",
".git",
".venv",
"venv"]

line-length = 88
indent-width = 4

target-version = "py39"

[lint]
select = ["E4", "E7", "E9", "F", "B", "D417"]
# extend-select = ["D417"] deactivated by default in case of pep257 codestyle.
# see also: https://docs.astral.sh/ruff/rules/undocumented-param/
ignore = ["B008", "D107", "D203", "D212", "D213", "D402", "D413", "D415", "D416", "E722", "E731", "F403", "F405", "F841", "B904"]
fixable = ["ALL"]
unfixable = []
# ignore list in docstring according to numpy codestyles for Dxxx.
# http://www.pydocstyle.org/en/5.0.1/error_codes.html#default-conventions
# B904: Within an `except` clause, raise exceptions with `raise ... from err` or `raise ... from None` to distinguish them from errors in exception handling

[lint.pydocstyle]
convention = "pep257"

[format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
10 changes: 10 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[pycodestyle]
count = False
ignore = E226,E302,E71, W293, W291, E731, E502, E722, W605
max-line-length = 160
statistics = True

# E502: the backslash is redundant between brackets
# E731: do not assign a lambda expression, use a def
# E722 do not use bare 'except'
# W605 invalid escape sequence \xxx for LaTeX commands

0 comments on commit 6cfb112

Please sign in to comment.