From 054c2a09c7a262ccf0923d37a4898fc3c13b004e Mon Sep 17 00:00:00 2001 From: A_D Date: Wed, 9 Sep 2020 17:13:13 +0200 Subject: [PATCH] Added noqa, docstring, and fstring linters Additionally this removed one linter that was for preferring .format to modulo formatting, as the new fstring linter does both --- .flake8 | 16 +++++++++++++--- requirements-dev.txt | 4 +++- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/.flake8 b/.flake8 index 03d0e79c..49e1306e 100644 --- a/.flake8 +++ b/.flake8 @@ -17,9 +17,6 @@ per-file-ignores = ./EDMC.py:E402 # https://github.com/Melevir/flake8-cognitive-complexity # Provides cognitive complexity checking -# https://github.com/gforcada/flake8-pep3101 -# Marks modulo-formatting as an error, as .format formatting is clearer and preferred in this codebase - # https://github.com/adamchainz/flake8-comprehensions # Checks list/dict/set/* comprehensions for simplification or replacement @@ -29,5 +26,18 @@ per-file-ignores = ./EDMC.py:E402 # https://github.com/best-doctor/flake8-annotations-coverage # Checks code for type annotations +# https://pypi.org/project/flake8-isort/ +# Ensures imports are well sorted + +# https://pypi.org/project/flake8-noqa/ +# Ensures that noqa statements are correctly formed + +# https://github.com/MichaelKim0407/flake8-use-fstring +# Prefers fstrings over .format and modulo based formatters max-cognitive-complexity = 15 + +# require that all noqa directves disable specific errors +noqa-require-code = True + +docstring-convention = numpy diff --git a/requirements-dev.txt b/requirements-dev.txt index cdd511d1..3de3dd5b 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,11 +3,13 @@ flake8==3.8.3 flake8-annotations-coverage==0.0.4 flake8-cognitive-complexity==0.0.2 flake8-comprehensions==3.2.3 -flake8-pep3101==1.3.0 flake8-polyfill==1.0.2 flake8-json flake8-isort==3.0.1 pep8-naming==0.11.1 +flake8-noqa==1.0.5 +flake8-docstrings==1.5.0 +flake8-use-fstring==1.1 # Code formatting tools autopep8==1.5.3