PyCQA / flake8-import-order

Flake8 plugin that checks import order against various Python Style Guides
GNU Lesser General Public License v3.0
278 stars 72 forks source link

Conflict with Pylint in test modules #152

Closed dmtucker closed 6 years ago

dmtucker commented 6 years ago
...
├── setup.py
├── src
│   └── backlog
│       ├── backlog.py
│       ├── cli.py
│       ├── __init__.py
│       └── __main__.py
├── tests
│   ├── test_backlog.py
...

If the top of test_backlog.py is:

import os
import random
import uuid

import pytest

from backlog import Backlog
_____________________________________________ FLAKE8-check ______________________________________________
/home/david/Projects/backlog/tests/test_backlog.py:10:1: I100 Import statements are in the wrong order. 'from backlog import Backlog' should be before 'import pytest' and in a different group.

If I change it to this:

import os
import random
import uuid

from backlog import Backlog

import pytest
____________________________________ [pylint] tests/test_backlog.py _____________________________________
C: 10, 0: third party import "import pytest" should be placed before "from backlog import Backlog" (wrong-import-order)

I tend to agree with Pylint here since it's consistent with how imports should be done in the package itself.

sigmavirus24 commented 6 years ago

Can you share your flake8-import-order config? Do you have backlog listed as an application name? I think that solves this inconsistency.

pgjones commented 6 years ago

I agree with @sigmavirus24 you likely need to configure flake8-import-order.

dmtucker commented 6 years ago

Ah, thank you both. Indeed, I have no configuration set... We can mark this invalid. Sorry for the false alarm.