Skip to content

Commit b211de5

Browse files
committed
chore: make isort and flake8-isort available
Signed-off-by: Jan Kowalleck <[email protected]>
1 parent 1bdb798 commit b211de5

File tree

5 files changed

+83
-3
lines changed

5 files changed

+83
-3
lines changed

.isort.cfg

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[settings]
2+
## read the docs: https://pycqa.github.io/isort/docs/configuration/options.html
3+
## keep in sync with flake8 config - in `tox.ini` file
4+
known_first_party = cyclonedx
5+
skip_gitignore = true
6+
skip_glob =
7+
build/*,dist/*,__pycache__,.eggs,*.egg-info*,
8+
*_cache,*.cache,
9+
.git/*,.tox/*,.venv/*,venv/*
10+
_OLD/*,_TEST/*,
11+
docs/*
12+
combine_as_imports = true
13+
default_section = THIRDPARTY
14+
ensure_newline_before_comments = true
15+
include_trailing_comma = true
16+
line_length = 120
17+
multi_line_output = 3

CONTRIBUTING.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,18 @@ poetry install
1818
## Code style
1919

2020
This project uses [PEP8] Style Guide for Python Code.
21-
Get it applied via:
21+
This project loves sorted imports.
22+
Get it all applied via:
2223

2324
```shell
25+
poetry run isort .
2426
poetry run autopep8 --in-place -r .
2527
```
2628

2729
## Testing
2830

31+
Run all tests in dedicated environments, via:
32+
2933
```shell
3034
poetry run tox
3135
```

poetry.lock

Lines changed: 56 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,11 @@ tox = "^3.24.3"
5959
coverage = "^6.2"
6060
mypy = ">= 0.920, < 1.00"
6161
autopep8 = "^1.6.0"
62+
isort = { version = "^5.10.0", python = ">= 3.6.1" }
6263
flake8 = "^4.0.1"
6364
flake8-annotations = {version = "^2.7.0", python = ">= 3.6.2"}
6465
flake8-bugbear = "^22.1.11"
66+
flake8-isort = { version = "^4.1.0", python = ">= 3.6.1" }
6567
jsonschema = { version = ">= 4.4.0", python = "> 3.6"}
6668
lxml = ">=4.7.0"
6769
xmldiff = ">=2.4"

tox.ini

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,10 @@ commands =
4141
poetry run flake8 cyclonedx/ tests/
4242

4343
[flake8]
44+
## keep in sync with isort config - in `isort.cfg` file
4445
exclude =
45-
build,dist,__pycache__,.eggs,*_cache
46+
build,dist,__pycache__,.eggs,*.egg-info*,
47+
*_cache,*.cache,
4648
.git,.tox,.venv,venv
4749
_OLD,_TEST,
4850
docs

0 commit comments

Comments
 (0)