Skip to content

Commit

Permalink
Merge pull request #152 from cclauss/patch-1
Browse files Browse the repository at this point in the history
GitHub Action to lint Python code
  • Loading branch information
tonybaloney authored Jul 15, 2022
2 parents ae9e6f6 + 8b26d58 commit 8ad2767
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
30 changes: 30 additions & 0 deletions .github/workflows/lint_python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: lint_python
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
lint_python:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.x
- run: pip install --upgrade pip wheel
- run: pip install bandit black codespell flake8 flake8-2020 flake8-bugbear
flake8-comprehensions flit isort mypy pydocstyle pytest pyupgrade safety
- run: bandit --recursive --skip B101,B324 .
- run: black --check --line-length 100 . || true
- run: codespell --ignore-words-list="fo,wil" --skip="*.po,*.svg"
- run: flake8 . --ignore C408,C416,E302,E402,E712,E741,F401,F541,F821,F841,R503,R504,W292,W293,W503
--count --max-complexity=24 --max-line-length=218 --show-source --statistics
- run: isort --check-only --profile black . || true
- run: pydocstyle --ignore=D203,D212,D301 wily
- run: flit install && pip install mock
- run: mkdir --parents --verbose .mypy_cache
- run: mypy --ignore-missing-imports --install-types --non-interactive . || true
- run: pytest .
- run: shopt -s globstar && pyupgrade --py37-plus **/*.py || true
- run: pip install safety && safety check # Must pip install to replace old version of `click`
2 changes: 1 addition & 1 deletion src/wily/operators/maintainability.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def mode(data):
"""
Return the modal value of a iterable with discrete values.
If there is more than 1 modal value, arbritrarily return the first top n.
If there is more than 1 modal value, arbitrarily return the first top n.
"""
c = Counter(data)
mode, freq = c.most_common(1)[0]
Expand Down

0 comments on commit 8ad2767

Please sign in to comment.