Skip to content

Commit

Permalink
Enable linting in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
avalentino committed Nov 2, 2024
1 parent c49426a commit ab26a22
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[flake8]
# max_line_length = 79
# max-complexity = 10
doctests = true
# https://github.com/psf/black/blob/main/docs/guides/using_black_with_other_tools.md
extend-ignore = E203,E501,E701,W503,SC,CNL,D,A,N,BLK,CCR,B902
# extend-ignore = I # flake8-import-order: not compatible with isort
# extend-ignore = SC # flake8-spellcheck: too aggressive
# extend-ignore = CNL # flake8-class-newline: incompatible with black
# extend-ignore = A003,A005 # Python builtin is shadowed by class attribute / module
extend-select = W504,B950
# https://docs.astral.sh/ruff/rules/#pydocstyle-d
# D105: undocumented-magic-method
# D107: undocumented-public-init
# extend-ignore = E203,W503,D105,D107 # D* are in pyproject.toml
per-file-ignores =
**/tests/*: D,T003
tables/__init__.py: E402,F401,F403,F405
statistics = True
count = True
extend-exclude = **/tests/*

# flake8-cognitive-complexity
# max-cognitive-complexity = 7 # default
max-cognitive-complexity = 11

# flake8-noqa
noqa-require-code = True

# flake8-spellcheck
dictionaries = en_US,python,technical,pandas
# spellcheck-allowlist-file = .spellcheck-allowlist
23 changes: 23 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,29 @@ jobs:
path: dist/*.tar.gz


lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"

- name: Install lint dependencies
shell: bash
run: |
python -m pip install --upgrade pip
python -m pip install flake8
if [ -f requirements-lint.txt ]; then pip install -r requirements-lint.txt; fi
- name: Lint (flake8)
run: |
python -m flake8 --count --show-source --statistics tables
build:
name: ${{ matrix.os }} ${{ matrix.python }} ${{ matrix.numpy }} ${{ matrix.name }}
runs-on: ${{ matrix.os }}
Expand Down

0 comments on commit ab26a22

Please sign in to comment.