Comments (5)
Can't fully reproduce. The error is raised for "import os", so this yields errors:
import sys # noqa
import os
while this does not:
import sys
import os # noqa
from flake8-import-order.
Try with 3 to better see the problem:
import argparse
import calendar # noqa
import base64
./foo.py:1:1: F401 'argparse' imported but unused
./foo.py:3:1: F401 'base64' imported but unused
./foo.py:3:1: I100 Imports statements are in the wrong order. import base64 should be before import calendar
The problem is clearly the second import (calendar). Flake8 does the right thing and ignores the "imported but unused" module, but your plugin still says that they are in wrong order. You should ignore the import where the # noqa comment is added. In the case with only 2 imports it should be irrelevant where the # noqa comment is placed. An error should never be raised.
from flake8-import-order.
FWIW I am not a maintainer of this project.
from flake8-import-order.
To see the problem from another perspective, here I have to use two comments instead of just one where the problem really is:
import calendar
import argparse # noqa
import base64 # noqa
P.S. Got it, you're not a maintainer, it's not your fault, you just work here. Eheheh, I'm joking!
from flake8-import-order.
I think I probably assumed that flake8 would take care of that for me :( I think I can implement this though.
from flake8-import-order.
Related Issues (20)
- 'from .a import a' should be before 'from .. import b' HOT 1
- Proposal to archive this project recommending Flake8-isort instead HOT 11
- Unable to disable warnings via tox.ini HOT 3
- pycharm: case-sensitivity of module names in "from" imports
- How to configure? HOT 9
- Not detecting local imports HOT 1
- Third-party after local import should be forbidden but isn't
- Two Third Party imports in the same block throws I201 error HOT 5
- _csv is identified as Third Party instead of Stdlib HOT 8
- isort-compatible style HOT 1
- Apply the ordering rules to __all__ HOT 2
- Weird I202 error HOT 5
- error in flake8-import-order setup command: 'install_requires' must be a string or list of strings containing valid project/version requirement specifiers; slice indices must be integers or None or have an __index__ method HOT 1
- Support graphlib
- flake8 version 6.0.0 regression in parsing arguments (seen with flake8-import-order extension) HOT 1
- Exception when using with flake8 v6.0.0 HOT 2
- What is the recommended way to auto-format sources to match this checker ? HOT 1
- Support linitng imports under if TYPE_CHECKING: HOT 2
- `DeprecationWarning: pkg_resources is deprecated as an API` on python 3.11 HOT 1
- No new-line between third-party and application?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flake8-import-order.