From ffbedec17acfbd3259f7fd1882eae2187bb9efab Mon Sep 17 00:00:00 2001 From: Jan Kowalleck Date: Wed, 25 Oct 2023 20:18:45 +0200 Subject: [PATCH] chore: own config file for flake8 Signed-off-by: Jan Kowalleck --- .editorconfig | 2 +- .flake8 | 20 ++++++++++++++++++++ .isort.cfg | 5 ++++- tox.ini | 16 ---------------- 4 files changed, 25 insertions(+), 18 deletions(-) create mode 100644 .flake8 diff --git a/.editorconfig b/.editorconfig index 17d087db6..0b244df1e 100644 --- a/.editorconfig +++ b/.editorconfig @@ -31,7 +31,7 @@ trim_trailing_whitespace = false indent_style = space indent_size = 4 -[*.ini] +[{*.ini,.bandit,.flake8}] charset = latin1 indent_style = space indent_size = 4 diff --git a/.flake8 b/.flake8 new file mode 100644 index 000000000..cdf555dea --- /dev/null +++ b/.flake8 @@ -0,0 +1,20 @@ +[flake8] +## https://flake8.pycqa.org/en/latest/user/configuration.html +## keep in sync with isort config - in `.isort.cfg` file + +exclude = + build,dist,__pycache__,.eggs,*.egg-info*, + *_cache,*.cache, + .git,.tox,.venv,venv + _OLD,_TEST, + docs + +max-line-length = 120 + +#max-complexity = 10 + +ignore = + # ignore `self`, `cls` markers of flake8-annotations>=2.0 + ANN101,ANN102 + # ignore ANN401 for dynamically typed *args and **kwargs + ANN401 diff --git a/.isort.cfg b/.isort.cfg index 445c5bac9..4e7e1a89c 100644 --- a/.isort.cfg +++ b/.isort.cfg @@ -1,6 +1,6 @@ [settings] ## read the docs: https://pycqa.github.io/isort/docs/configuration/options.html -## keep in sync with flake8 config - in `tox.ini` file +## keep in sync with flake8 config - in `.flake8` file known_first_party = cyclonedx_py skip_gitignore = true skip_glob = @@ -15,3 +15,6 @@ ensure_newline_before_comments = true include_trailing_comma = true line_length = 120 multi_line_output = 3 +src_paths = + cyclonedx_py + tests diff --git a/tox.ini b/tox.ini index 2877d268f..fdb796f7c 100644 --- a/tox.ini +++ b/tox.ini @@ -37,19 +37,3 @@ commands = skip_install = True commands = poetry run flake8 cyclonedx_py/ tests/ - -[flake8] - ## keep in sync with isort config - in `isort.cfg` file -exclude = - build,dist,__pycache__,.eggs,*.egg-info*, - *_cache,*.cache, - .git,.tox,.venv,venv - _OLD,_TEST, - docs -max-line-length = 120 -ignore = - E305 - # ignore `self`, `cls` markers of flake8-annotations>=2.0 - ANN101,ANN102 - # ignore ANN401 for dynamically typed *args and **kwargs - ANN401