pycodestyle_magic icon indicating copy to clipboard operation
pycodestyle_magic copied to clipboard

max_line_length option ignored

Open stoffprof opened this issue 5 years ago • 4 comments

It looks like the max_line_length option for flake8 is being ignored in my setting. Can you see what I'm doing wrong?

Screen Shot

Note that if I include --ignore E231 the warning message is suppressed, so that option seems to be working.

Here's the raw code for my example:

%load_ext pycodestyle_magic
%flake8_on --max_line_length 60

import numpy as np
import pandas as pd
import string

pd.DataFrame(np.random.randn(100,26), columns=list(string.ascii_uppercase))
len("pd.DataFrame(np.random.randn(100,26), columns=list(string.ascii_uppercase))")

stoffprof avatar Dec 09 '19 14:12 stoffprof

Thanks for raising the issue! Your code gives me the following:

image

Which raises on the line that is too long. I'm on pycodestyle_magic version 0.5. But funny enough the last line that you mention doesn't work for me either.

mattijn avatar Dec 09 '19 20:12 mattijn

My pycodestyle_magic version is also 0.5. Can you think of what else the difference could be?

stoffprof avatar Dec 09 '19 20:12 stoffprof

Hm. Its hard to say. The settings are parsed to flake8 here:

    flake = flake8_module.get_style_guide(
        extend_ignore=ignore_codes, 
        max_line_length=max_line_length
    )

If I do:

import flake8
flake8.__version__

I got version 3.7.9. What version are you on? But since the ignore_codes part for you is working.. that probably won't be the problem

mattijn avatar Dec 09 '19 20:12 mattijn

Ya, I'm on 3.7.9 also.

stoffprof avatar Dec 09 '19 21:12 stoffprof