flake8 on all files under specific subdirectories
Asked Answered
H

1

8

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?

Heirloom answered 11/4, 2022 at 13:29 Comment(0)
A
11

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

Anatto answered 11/4, 2022 at 13:50 Comment(2)
How do you check for all subdirectories? Is it flake8 ./* or flake8 **/** or something else?Fleck
I believe I got my answer it's: flake8 **/*.pyFleck

© 2022 - 2024 — McMap. All rights reserved.