Skip to content

Commit

Permalink
ci: Updated isort config and related CI job (#118)
Browse files Browse the repository at this point in the history
* chore: Added separate isort config

* chore: Updated flake8 config

* ci: Updated CI isort job

* docs: Updated makefile
  • Loading branch information
frgfm committed Dec 1, 2021
1 parent c1b1103 commit 9b2cc3b
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[flake8]
max-line-length = 120
ignore = E402, E265, F403, W503, W504, E731
exclude = .circleci, .git, venv*, docs, build
exclude = .github, .git, venv*, docs, build
per-file-ignores = **/__init__.py:F401
4 changes: 3 additions & 1 deletion .github/workflows/style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ jobs:
- name: Run isort
run: |
pip install isort
isort **/*.py -c -v
isort --version
isort .
if [ -n "$(git status --porcelain --untracked-files=no)" ]; then exit 1; else echo "All clear"; fi
mypy-py3:
runs-on: ${{ matrix.os }}
Expand Down
5 changes: 5 additions & 0 deletions .isort.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[settings]
line_length = 120
src_paths = torchcam,tests
skip_glob=**/__init__.py
known_third_party=torch,torchvision
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# this target runs checks on all files
quality:
isort **/*.py -c -v
isort . -c -v
flake8 ./
mypy torchcam/

# this target runs checks on all files and potentially modifies some of them
style:
isort **/*.py
isort .

# Run tests for the library
test:
coverage run -m pytest tests/

# Check that docs can build
docs:
cd docs && bash build.sh
cd docs && bash build.sh
3 changes: 0 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[metadata]
description-file = README.md
license_file = LICENSE

[isort]
line_length = 120

0 comments on commit 9b2cc3b

Please sign in to comment.