-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Radon as a flake8 plugin #76
Comments
I think it would. As for now, I only added the option I made a couple of runs and it seems to work as expected. Would you use other options? (Like |
@rubik wow, that was quick. First of all, The current problem is, I think, that
and it terminates if max-complexity is less than 0:
which makes Thanks! |
Wow, I feel dumb. Thanks for catching that bit. I also added The problem now is that one could supply |
Thanks for the quick fix. Yeah, current behavior could be confusing. It doesn't sound good to have May be it makes sense to enable radon checker if any of the radon-specific options are set applying defaults for others.. Also, would it be possible to put the "Maintainability Index" under the control too? |
I'll think about this, maybe there is a better solution.
It certainly would, but MI is a very experimental metric which almost no one uses and I added just for my own interest. While CC is objectively useful, there are some concerns about MI, which are summed up nicely in this well-researched blog post by Arie van Deursen: I would therefore abstain from adding it to flake8. |
@rubik yeah, I agree, it is a quite controversial measurement. Makes sense. |
I don't think there's a good way to handle it for the user. The best idea is to enable the checker when a radon specific option is set, but then consider this case:
In this case the radon checker should be enabled, but what should the default be for Since I think automatically changing defaults is even more confusing than having |
I'll now write some docs on this and then I'll release version 1.2.2 |
I still like the idea that any radon-specific option enables the checker - it just sounds logical. In case of:
we can apply a default
We can try adding debug messages, like "Max complexity was not specified, using the default 10 value". On the other hand, I guess |
For one I don't know if it's possible to print a debug message, the plugin interface does not seem to support it. And furthermore what you are saying makes sense. A sensible default value would work (aside from -1, which is there only to disable the checker). I think 10 is a good one. |
Version 1.2.2 has been released on PyPI. |
Thank you for the quick changes! |
Would it make sense to make a simple wrapper around
radon
to make itflake8
pluggable (similar to mccabe)?Thanks.
The text was updated successfully, but these errors were encountered: