Giter Club home page Giter Club logo

Comments (5)

untitaker avatar untitaker commented on August 22, 2024

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.

philtay avatar philtay commented on August 22, 2024

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.

untitaker avatar untitaker commented on August 22, 2024

FWIW I am not a maintainer of this project.

from flake8-import-order.

philtay avatar philtay commented on August 22, 2024

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.

public avatar public commented on August 22, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.