linter-flake8 icon indicating copy to clipboard operation
linter-flake8 copied to clipboard

Ignore error codes and max line length configuration ignored

Open ZviBaratz opened this issue 7 years ago • 12 comments

Hey all,

I have a fresh install of Atom 1.23.3 and I've installed the linter-flake8 package and its dependencies. I shouldn't have nor did I manage to find any alternative configuration files, yet the ignore error codes and max line length configurations do not seem to make a difference even though the ~/.atom/config.cson file is updated accordingly.

Atom config: image

config.cson: image

editor: image

I've never actually posted an issue and am relatively new to all this, so I hope it makes sense. Thank you for your awesome work! Zvi

ZviBaratz avatar Jan 10 '18 20:01 ZviBaratz

Hey @ZviBaratz , do you have any file named setup.cfg, tox.ini or .flake8 in the root of your project?

lucasdf avatar Jan 10 '18 21:01 lucasdf

None of the above. I do have a config.py file, however, I even tried renaming that file and still no luck. Here's the root tree: image

Perhaps it is worth noting I previously worked with PyCharm? Could that somehow interfere?

ZviBaratz avatar Jan 11 '18 07:01 ZviBaratz

Could well be a bug here. I do not think most python dev who care about pep8 compliance would change the line length… I certainly do not.

ddaanet avatar Jan 11 '18 13:01 ddaanet

I only tried changing the line length due to the E501 ignore failure, and frankly, I only tried to ignore E501 because wrapping didn't solve it. I was also surprised to learn wrapping indents the line continuation to the beginning of the previous line instead of indenting further. Is there a way to customise that? I much prefer the PyCharm-like appearance of line continuation. Example: image

ZviBaratz avatar Jan 11 '18 16:01 ZviBaratz

I'm starting a long-term commitment, contributing to a well-established project that is configured to allow longer line lengths. I don't have the ability to change the project's conventions, so even though it might be ideal to have a 79-char enforcement, that's not my reality. It would be lovely to have this addressed if at all possible!

lyzadanger avatar Jan 31 '18 17:01 lyzadanger

Ah! Update! In my case, part of the problem was because of the default ordering of the Project Config File setting. The project I'm working on has both a tox.ini and a setup.cfg. The max-line-length value (exception) is in the setup.cfg in this project, which doesn't get picked up (presumably because the package sees tox.ini first and uses that). By swapping around the ordering of Project Config File in my settings—putting setup.cfg first—I can "fix" this for this project (i.e. line length maxima are correctly set to the project's setup.cfg value).

However, this doesn't address this issue—as, as far as I can tell, the package's "Max Line Length" and "Ignore Error Codes" don't work (at least not with respect to E501) without the configuration file, but as a workaround, a configuration file with a max-line-length rule does appear to work.

lyzadanger avatar Feb 05 '18 15:02 lyzadanger

'Ignore Error Codes' still doesn't work, right? Or did someone find a workaround? Cheers

paul-grassl avatar Jan 14 '19 10:01 paul-grassl

I ran into a variant of this. I have the max line length linter-flake8 configuration set to 100 characters. I would expect that to be the setting, regardless of any other files in the project. However, it happens that there is a setup.cfg where that config has:

[flake8]
exclude = extern,*parsetab.py,*lextab.py

There is no max-line-length mentioned, but atom-linter seems to take the lack of an explicit max-line-length to mean use the default 80 no matter what (even overriding my value in the linter-flake8 config). That seems like a bug. If I put max-line-length = 100 in the setup.cfg file then 100 is the value which gets used.

taldcroft avatar Sep 25 '19 20:09 taldcroft

I have the same problem. Cleaned up any config files and restarted atom to no avail. I use black for formatting so formatting messages are just noise for me and line length is set at 88 per Łukasz Langa wisdom.

piccolbo avatar Jul 21 '20 16:07 piccolbo

Maybe it's a problem into the instalation itself, you can check this link if you want and you may find how to install the docstring of python Fix-Linter-flak8.

AI-Ahmed avatar Oct 15 '20 16:10 AI-Ahmed

I have the same problem too. If these configuration options are ignored, they should be removed from the package settings.

mullenkamp avatar Jan 21 '21 20:01 mullenkamp

Same issue here. Any updates on this?

ogencoglu avatar Dec 28 '21 12:12 ogencoglu