-
-
Notifications
You must be signed in to change notification settings - Fork 8
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
ISort does use isort default and not plone.api conventions #163
Comments
You need to provide an Copy it from p.r.codeanalysis: https://github.com/plone/plone.recipe.codeanalysis/blob/master/.isort.cfg |
Where is this documented? why is this not the default? |
Because this is coming from |
What can be done is to add arguments on And that's why I closed the issue before, the problem is on flake8-isort not on p.r.codeanalysis. I let you close this time :) |
plone.recipe.codeanalysis gives unreliable and wrong results because it uses flake8-isort. It breaks CI environments right now, maybe it should just be blacklisted, or maybe it doesn't matter which repo needs the error report because its both maintained by the same people. |
You are totally free to enable or disable plugins as you like, if you add |
@gforcada you dropped a well reviewed code and replaced it with a fast-track released |
The idea of creating flake8 plugins is that apart from flake8-plone-api and flake8-plone-hasattr they are generic to be reused by any other python project, and as in this plugin there is already a way to configure it, problem is solved. As I said, we can add arguments to it and passing them via p.r.codeanalysis, but right now you have a solution at your fingertips. |
@saily flake8-isort is just a shim over isort, and that's not a fast-tracked project. Just disable it if it doesn't suite your needs, or provide pull requests to improve it. You can even stick to an older release of p.r.codeanalysis until you are fine with the last one. That's why it was changed from 2.0.X to 2.1. semver at its best. |
i'm pretty sure all of us experienced ploners know how to handle this, but the point is you're making it pretty complex for new developers because behaviour changed completely after a minor release upgrade from |
I agree. Even with the undocumented |
@saily @do3cc since I made the release I guess I'm the one to blame here. I was under the assumption that the flake8-plugins would be a simple drop-in replacement. I did a quick test before the release. Since I haven't used the sort feature yet, I did not catch that problem. Though, we are taking about one regression here, as far as I can see. Calling 2.1 a brown bag release is not really encouraging people to fix the problem. We should have made a 3.0 release and document that breaking change in a better way, no question about that. |
We're not blaming people here and we're not requesting a fix, we just don't want to close the issue as far as i see! |
@saily that's fine with me. :) |
@saily I think, that the .isort.cfg actually makes sense. Because then you have the same config for each team member, not only for the checker, but for the editor integration to automatically sort imports. |
Should we close this already? Maybe some docs are needed only? |
Since 25 days nobody objected, so closing now. |
But has it been fixed? |
I really hate the way we just ignore crap. Introducing a new import checker which checks for the wrong conventions by default is crap. So leave this open until it's fixed. |
@saily gil asked 26 days ago if we can close the issue. If nobody objects it's perfectly ok to close the issue. Calling things "crap" does not really help either to motivate people to put effort into fixing it...I'm ok with keeping this issue open if the new checker breaks with the old convention. |
@tisto i disagree here. i invested a lot of time implementing the original sort checker. The community was inconsistent about their own conventions and @gforcada came up with the discussion changing the conventions. After that he claimed about my wrong implementation and implemented his own one, which checks wrong by default as well. I do not understand how we as testing team can accept replacements which do not work in their shipped configuration. This doesn't help at all and just makes it even more hard to start writing valid code for beginners. Sorry for being upset, but from my point of view this is really "crap". |
I just asked a question if it is fixed. If it isn't the ticket can be closed if we revert the commits that break out of the box sort behavior. |
@tisto I was trying to write something polite but I fail at it, so don't expect me on that meeting, I just can not see how we can discuss if things are ruled out directly. I see a lot of options before insulting others works:
but just providing stop energy and insulting is not my way of work sorry. @do3cc as you already did before, fixing isort upstream is the way to go IMHO, my changes and your changes are already merged and released, so chances are that if you provide the improvements they will be accepted and released. |
Let us bring the discussion back on track. |
at least until it does not work according to plone.api style guide See also #163
Folks, mistakes or even not mistakes but decisions not all of us are happy with just happen. Keep calm and fix it :-) Explicit is better than implicit What about adding an option to the flake8 plugin, that requires a existing file Then we add to all plone core packages the |
I'd be fine with an option. I created the Pull Request yesterday because I was bitten by it again. A project that uses plone.app.codeanalysis, lots of false errors because no .isort file. |
Just before leaving for Christmas vacations: flake8-isort 1.0 Without any additional configuration it will show: if no Adding a |
@gforcada I am sorry, but after having worked with the isort plugin for a while, I am now against adding this to plone.recipe.codeanalysis at all. This is also in part a tooling problem that in theory could be fixed. I am against adding the flake8-isort plugin, because it is a lot of work to get it right for every developer, for a very small benefit. Here are the problems:
Because of this, I'd prefer to see the old sort plugin back which, also seems to conform to the plone.api style guide soonishly again. plone/plone.api#187 (comment) I know that this is a tough because a lot of emotions and energy have been put into all of this. I hope you see that I have given the isort option a serious chance and used it extensively. I even managed to get it working for me. I just don't see that all this work I had is justified for every one who might be willing to contribute to a project that uses plone.app.codeanalysis[recommended] |
@do3cc, in reverse order:
And last point, just like the current sorting was added, the same sorting reversed could be added as well, yet another sorting option. What bothers me with on this topic is that instead of trying to fix the issues at the correct level we are just either trying to patch or have a DIY syndrome. Sure, add back the previous checker, but you are going to miss the automatic fixing of isort, etc etc etc. Just think about the idea of modernizing any And finally regarding plone.api convention, I really don't care if it's one way or another (at least regarding sorting imports) as long as there is a tool that reports and fixes that by myself I'm totally happy to change the decision every second month, fixing it is just one command and commit away, no more, no less work. But as I said above, feel free to add it the previous checker back... |
Hi, Regarding .isort.cfg, I've had a second look at django. They use Isort and they have their code checked for compliance. They don't use .isort.cfg, they use setup.cfg. I've tried this and it seems to work. |
With the latest changes from @gforcada to flake8-isort there is a warning if not isort settings are configured. |
:-(
The text was updated successfully, but these errors were encountered: