Skip to content

Commit

Permalink
refactor(ci-cd): update linter workflow (#96)
Browse files Browse the repository at this point in the history
* Cache poetry installation

* Skip install dependencies if cache hit

* Fix setup python job id

* Add isort config

* Extend flake8 config

* Update linter workflow
  • Loading branch information
NibiruHeisenberg authored Aug 19, 2022
1 parent 1447c37 commit 33505c0
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
20 changes: 15 additions & 5 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,19 @@ jobs:
with:
python-version: "3.9.13"

- name: flake8 Lint
uses: py-actions/flake8@v2
#----------------------------------------------
# load pip cache if cache exists
#----------------------------------------------
- uses: actions/cache@v2
with:
ignore: "W503,E501,F811,F541,W605,E203,F405,E722,W191,F403,F821,E101,N806,N802,N801,N811,N818"
exclude: "nibiru/proto/*"
max-line-length: "88"
path: ~/.cache/pip
key: ${{ runner.os }}-pip
restore-keys: ${{ runner.os }}-pip
#----------------------------------------------
# install and run linters
#----------------------------------------------
- run: python -m pip install black flake8 isort
- run: |
flake8 .
black . --check
isort .
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ extend-exclude = '''
)$
'''

[tool.isort]
profile = "black"
py_version = 39
skip_glob = ["nibiru/proto/*"]

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[flake8]
max-line-length = 88
exclude = .git,nibiru/proto/*
exclude = .git,nibiru/proto/*,build/
ignore = W503,E501,F811,F541,W605,E203,F405,E722,W191,F403,F821,E101,N806,N802,N801,N811,N818

[options]
Expand Down

0 comments on commit 33505c0

Please sign in to comment.