question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

flake-isort generating false warnings when running flake8 on Windows

See original GitHub issue

Bug report

flake-isort is generating false warnings when running flake8 with flake8-isort installed on Windows 10 machine.

What’s wrong

Having file with the contents:

# -*- coding: UTF-8 -*-
"""Module docstring."""

print('hello')

Running

C:\Temp\SampleEnvIsortOnly\Scripts
(SampleEnvIsortOnly) λ flake8 "C:\Development\Flake8PluginDev\foo.py"

on Windows 10 gives

C:\Development\Flake8PluginDev\foo.py:2:1: I001 isort found an import in the wrong position
C:\Development\Flake8PluginDev\foo.py:4:1: I003 isort expected 1 blank line in imports, found 0

when there are really no imports in the file.

Running

(SamplePyEnv) linuxuser@LinuxMachine:~/Development/SamplePyEnv$ flake8 /home/linuxuser/Development/Sample/foo.py

on the file with the same contents on Linux Ubuntu does not produce any warnings.

How is that should be

The flake8-isort should not generate these false warnings for file with the provided content on Windows machines.

System information

flake8 information

Contents of flake8 --bug-report:

(SampleEnvIsortOnly) λ flake8 --bug-report
{
  "dependencies": [
    {
      "dependency": "setuptools",
      "version": "39.0.1"
    }
  ],
  "platform": {
    "python_implementation": "CPython",
    "python_version": "3.6.6",
    "system": "Windows"
  },
  "plugins": [
    {
      "is_local": false,
      "plugin": "flake8_isort",
      "version": "2.3"
    },
    {
      "is_local": false,
      "plugin": "mccabe",
      "version": "0.6.1"
    },
    {
      "is_local": false,
      "plugin": "pycodestyle",
      "version": "2.3.1"
    },
    {
      "is_local": false,
      "plugin": "pyflakes",
      "version": "1.6.0"
    }
  ],
  "version": "3.5.0"
}

pip information

Contents of pip freeze:

(SampleEnvIsortOnly) λ pip freeze
flake8==3.5.0
flake8-isort==2.5
isort==4.3.4
mccabe==0.6.1
pycodestyle==2.3.1
pyflakes==1.6.0
testfixtures==6.3.0

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
AlexArcPycommented, Oct 16, 2018

I’ve tried various things but this seems to be specific to my Windows 10 environment. Since if I understood it right the appveyor tests on Windows pass, this issue could be closed and no further action is required in this regard.

0reactions
sobolevncommented, Oct 16, 2018

@AlexArcPy can this be closed? Have you figured out what was wrong?

Read more comments on GitHub >

github_iconTop Results From Across the Web

flake-isort generating false warnings when running flake8 on ...
Bug report flake-isort is generating false warnings when running flake8 with flake8-isort installed on Windows 10 machine.
Read more >
Warning / Error codes — flake8 2.6.0 documentation
The convention of Flake8 is to assign a code to each error or warning, like the pycodestyle tool. These codes are used to...
Read more >
flake8-isort - PyPI
Use isort to check if the imports on your python files are sorted the way you expect. Add an .isort.cfg to define how...
Read more >
Different flake8 behaviour locally and in tox - Stack Overflow
So I have a 3rd party lib import above the import from my lib. And everything is fine here, vscode with flake8 installed...
Read more >
wemake-python-styleguide - Issuehunt
False positive for `variable is only used in return`. Unfunded#598created bysobolevn ... Running all intended tests should be possible by one shell command....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found