I use PyCharm and have a pyproject.toml
, currently configured for flake8
.
Can I make PyCharm use the ignore list for its own inspections too?
My pyproject.toml
:
[tool.flake8]
ignore = [
"I101", # Imported names are in the wrong order
"I201", # Missing newline between import groups
]
I am not looking for a suggestion to configure flake8
as external tool in PyCharm, I am looking to alter/configure the live inspection of PyCharm, as shown e.g. its Problems tab.
I believe PyCharm's native inspections and
flake8
inspections are different, and PyCharm does not natively support importingflake8
configurations directly into its own inspection settings.As a workaround, you can try and manually configure PyCharm's inspections to mirror the ignore list in
pyproject.toml
. Go toFile > Settings > Editor > Inspections
in PyCharm, and adjust the inspection settings to reflect the rules you want to ignore, as specified in yourpyproject.toml
.Since PyCharm's inspections are not directly compatible with
flake8
, some rules might not have a one-to-one correspondence, and this process might involve some approximation.If you often change your
flake8
settings and want a more automated way to keep PyCharm in sync, consider writing a custom script or a PyCharm plugin that reads yourpyproject.toml
and adjusts PyCharm's inspection settings accordingly.