Closed Integralist closed 4 years ago
Apologies for the late reply @pgjones but coming back to this I changed my ~/.config/flake8
to use pep8 format (e.g. "only enforces groups without enforcing the order within the groups").
I then setup an example script that imports both asyncio
and time
but had asyncio imported after the time module and the validator complained that time should come after asyncio (which suggests the configuration isn't being picked up as the pep8 format shouldn't care about that) 🤔
I also used a local tox.ini
file to override behaviours like so:
[flake8-import-order]
import-order-style = edited
But discovered that my local files were being identified as 'third-party' and not local?
Here is the file tree:
.
├── example.py
├── foo
│  └── bar.py
└── tox.ini
You need to name the application (local) module names, docs, otherwise it assumes they are third party.
I've not come across ~/.config/flake8
so I'm not sure why that isn't picked up/used.
It looks like pep8 is the style you want.
I've not come across
~/.config/flake8
so I'm not sure why that isn't picked up/used.
Flake8 is certainly picking it up but we only read config from [flake8]
and we don't pass the file onto plugins. For y'all to get the settings forwarded to you, @Integralist would have to move the setting.
@sigmavirus24 silly question but regarding...
we only read config from [flake8] and we don't pass the file onto plugins
Does that mean my setting of import-order-style
isn't picked up by flake8 or something else entirely?
[flake8]
and [flake8-import-order]
are two distinctly named config sections. Flake8 only looks at its own. Thus yes, by putting import-order-style
anywhere else in ~/.config/flake8
Flake8 is not seeing that or considering it.
Awesome, thanks!
Tomorrow I'll try moving that setting to [flake8]
and see if this plugin starts to pick up the changed settings (unless I've misunderstood completely, which is very possible 😬)
This worked! Thanks 🙂
This is a silly question but I'm using vim's
nvie/vim-flake8
which runs the currently available flake8 command + extensions whenever editing a file.I've created a
~/.config/flake8
file with the following content:But no matter what I set the import-order-style to, my vim editor keeps showing the same error for the imports.
Specifically I have the following imports...
It sees them all as Third-Party and expects a line break between them.
Maybe the configuration is correct/working but I just don't have a style selected that's matching what I'm looking for 🤔
I ideally want to find a style that is:
Would this need to be a custom style?