Closed AdamGleave closed 3 years ago
I'm so sorry that I took so long to review this. I'm kind of surprised that flake8 doesn't have an option to disable an extension. (Since it does have an option to enable an extension.) Naively, I'd have expected flake8 to have requested extensions to register under a given error code prefix.
Anyway, I'd prefer to avoid adding new configuration options, if there is one which can be reused. Darglint currently has an option, --ignore-regex
. I don't know if this is a common option, though, so maybe it would be better to prefix it with "darglint", like --darglint-ignore-regex
. In any case, this would allow us a lot more flexibility in restricting checks. So, for your use case, the following would work:
flake8 --ignore-regex='.*' <dir>
This would run darglint, but it would short-circuit pretty quickly. (At least as quickly as your change.)
Would you like to update your PR, or would you like me to just make the change? Anyway, thanks for the suggestion -- it seems like a good addition!
Thanks for the suggestion, I agree this is a more elegant and flexible solution, I've updated the PR accordingly.
Looks good, thanks for the PR! I'll try to deploy it this weekend.
Sorry, took another week, but it should now be available in v1.8.1
Thanks!
When
darglint
is installed, it is run byflake8
automatically. This is a good default, but sometimes is undesirable. This PR adds a flag--darglint-disable
toflake8
to disabledarglint
on a case-by-case basis.In my case, running
flake8
on my entire source tree takes 4 minutes whendarglint
is installed, v.s. 4 seconds without. So I want to disable darglint when runningflake8
as a commit hook (where quick response is important), but still rundarglint
when running on continuous integration (where it's still faster than our unit test suite).