Search code examples
pythonflake8

flake8 on all files under specific subdirectories


I'm trying to use flake8 only on 3 specific sub directories: features_v2, rules_v2 and indicators_v2.

In order to test if my pattern is correct I tried applying it only to features_v2 at first. so I came up with this pattern: exclude = ^(?!.*features_v2).*$ but sadly it doesn't seems to work. Is flake8 does not support lookaround, or it does and I did something wrong?

Is there a better way to use flake on 3 different subdirectories?


Solution

  • flake8's exclude is not a regex but a glob -- it cannot support what you're looking for

    may I suggest instead to run flake8 on the directories you want?

    flake8 features_v2 rules_v2 indicators_v2
    

    disclaimer: I maintain flake8