flake8-isort
flake8-isort copied to clipboard
Not working with flake8
In a project I'm working on (can provide link if you need it) we have a pipeline setup to run flake8, but flake8-isort
doesn't seem to run correctly as it doesn't detect isort failures. Running isort only works fine, so I guess its the plugin :smile:
Isort config (.isort.cfg)
[settings]
profile = black
force_single_line = true
Flake8 config (.flake8)
[flake8]
count = true
ignore =
A002, # Argument is shadowing a python builtin.
A003, # Class attribute is shadowing a python builtin.
CFQ002, # Function has too many arguments.
D102, # Missing docstring in public method.
D105, # Magic methods not having a docstring.
D412, # No blank lines allowed between a section header and its content
E402, # Module level import not at top of file (isn't compatible with our import style).
IFSTMT001 # "use a oneliner here".
T101, # TO-DO comment detection (T102 is FIX-ME and T103 is XXX).
W503, # line break before binary operator.
W504, # line break before binary operator (again, I guess).
S101, # Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
# F401: unused import.
# F403: cannot detect unused vars if we use starred import
# FS003: f-string missing prefix.
# R102: unnecessary parenthesis on raised exception (raises false positives in places)
# S106: posible hardcoded password (we dont care about this in the tests)
# D106, D104, D103, D101, D100: Missing docstring in public function/class/module (ignore in tests)
per-file-ignores =
hikari/__init__.py: F401,F403
hikari/events/__init__.py: F401,F403
hikari/utilities/routes.py: FS003
hikari/utilities/date.py: FS003
hikari/impl/stateless_cache.py: R102
tests/hikari/*: FS003,S106,D106,D104,D103,D101,D100
max-complexity = 20
# TODO reset to 100 again if possible.
max-function-length = 130
# Technically this is 120, but black has a policy of "1 or 2 over is fine if it is tidier", so we have to raise this.
max-line-length = 130
show_source = False
statistics = False
accept-encodings = utf-8
docstring-convention = numpy
Flake8 plugins
# Android support
#flake8==3.8.3
git+https://gitlab.com/PyCQA/flake8@master
# Plugins
# Ref: https://github.com/DmytroLitvinov/awesome-flake8-extensions
flake8-bandit~=2.1.2 # runs bandit
flake8-black==0.2.1 # runs black
flake8-broken-line==0.2.1 # forbey "\" linebreaks
flake8-builtins==1.5.3 # builtin shadowing checks
flake8-coding==1.3.2 # coding magic-comment detectiong
flake8-comprehensions==3.2.3 # comprehension checks
flake8-deprecated==1.3 # deprecated call checks
flake8-docstrings==1.5.0 # pydocstyle support
flake8-executable==2.0.4 # shebangs
flake8-fixme==1.1.1 # "fix me" counter
flake8-functions==0.0.4 # function linting
flake8-html==0.4.1 # html output
flake8-if-statements==0.1.0 # condition linting
flake8-isort==4.0.0 # runs isort
isort==5.5.2
flake8_formatter_junit_xml==0.0.6 # junit
flake8-mutable==1.2.0 # mutable default argument detection
flake8-pep3101==1.3.0 # new-style format strings only
flake8-print==3.1.4 # complain about print statements in code
flake8-printf-formatting==1.1.0 # forbey printf-style python2 string formatting
flake8-pytest-style==1.3.0 # pytest checks
flake8-raise==0.0.5 # exception raising linting
flake8-use-fstring==1.1 # format string checking
@davfsa thanks for using flake8-isort and on top of it reporting the problems you find with it, so we can improve it :+1: :sparkles:
On to topic: it's a bit hard to debug, which kind of pipeline is that? :thinking: some sort of CI integration I guess?
Can you run the steps on that pipeline locally and the problem does happen as well? :thinking: it might be the way the environment is set on the pipeline that makes it not work? :thinking:
@gforcada Yes, I'm also able to reproduce on my machine, not only on CI
Sorry, that I never catch up again on this issue, but since there was no further input, I'm closing this. Please reopen if you still have the same problem.