-
Notifications
You must be signed in to change notification settings - Fork 18
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
Disable Autopep8 and Yapf if this plugin is installed #34
Conversation
This looks good to me, I will try it out later. What do you think @ccordoba12? |
This doesn't need to be handled here. Instead, your editor or IDE @bageljrkhanofemus needs to send a Plugins like this one are only in charge of offering configuration options and setting some defaults for them, not to set specific values on behalf of users. |
I was just wondering if there was a better solution to the conflicts caused by black - since it instantiates a line length of 88 while flake8 uses 80, causing alot of unneeded frustration. But if it is better to do so in your IDE/Editor configuration, could that be added that as an recommendation? |
I think we could leave here the configuration entries that disable
Sure, for flake8 that's the way to go. |
Done, I'll move discussion about flake8 to here python-lsp/python-lsp-server#186 |
I think the best way to handle this is through flake8's configuration files, so it would always work, not just python-lsp-server and not just the developers adjusting their IDE configuration. From black documentation: https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html#flake8 |
I think it's a good idea, I expect it would be useful to most users. However what would happen to an user that installed python-lsp-black globally but only tried to use it in some projects, while using yapf or autopep8 on others? Would manually overriding the configuration work? Whichever way we choose we should document the default behavior and how to override it. |
I was going to check how autopep8 and yapf handle it, when I noticed a couple of things
I wonder if there is a way to get the PluginManager from pluggy to disable other plugins at runtime |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me now, thanks @bageljrkhanofemus!
@bageljrkhanofemus Could you update the README to mention that python-lsp-black will by default disable yapf and autopep8 plugins from python-lsp-server? |
done |
You need to update black to 22.3.0 for github builds to work because black < 22.3.0 is broken with the latest version of click.. I don't see a dependency specification anywhere but you may want to specify it in a pyproject.toml file for PEP 517/518/621 compliant approach. I can help with that if you want me to. |
Here you can find the dependency on Black: Line 21 in 9c8e61c
Please update it to |
done |
Thanks @bageljrkhanofemus for your help to solve the Click issue! @haplo, what do you say? |
This looks good to me, thank you @bageljrkhanofemus for your work on this! I will merge tomorrow and release. |
This does 3 things: