You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Would it be possible to have the option to have an auto-format option with a custom set of rules, or where you specify the specific rules yourself?
I don't like to/can't use the auto-format with full PEP-8 style or so, but I would love to have some simple things be automatically corrected on saving, like trailing whitespaces (W291) or blank lines containing whitespace (W293). These are small things that sneak in so easily, and are a waste of time to correct manually.
It could be made just like "Ingore following errors and warnings"-box, except you specify the warnings/errors you want to be corrected.
The text was updated successfully, but these errors were encountered:
Would it be possible to have the option to have an auto-format option with a custom set of rules, or where you specify the specific rules yourself?
From our current auto-formatters, Black doesn't offer that possibility but Autopep8 does. However, that would require two things: designing the graphical interface to set those options on the Spyder side and adding support for them on python-lsp-server (the backend we use for auto-formatting, code completion and linting).
Unfortunately, we don't have time to this at the moment. So, the initiative to implement this feature would need to come from our community.
but I would love to have some simple things be automatically corrected on saving, like trailing whitespaces (W291) or blank lines containing whitespace (W293). These are small things that sneak in so easily, and are a waste of time to correct manually.
There's already an option to automatically do that:
Oh, cool. I wasn't aware of this option. Yes, that helps very much.
There are perhaps a few other warnings I'd like to include, but they're much, much less frequent and much easier to change (or just by getting used to writing it properly). So the stripping whitespace option mostly solves the problem for me, to the point where implementing something new wouldn't be worth it at all, certainly if I'm the only one interested.
Thanks.
PS: one question, do the option you marked and the one 3 lines up do the same with the only exception of when saving vs immediately?
So the stripping whitespace option mostly solves the problem for me
Great!
to the point where implementing something new wouldn't be worth it at all, certainly if I'm the only one interested.
We'll leave the issue open in case other people think this is worth the effort.
PS: one question, do the option you marked and the one 3 lines up do the same with the only exception of when saving vs immediately?
Right, and I forgot about it because I don't use it myself. I only want to remove white spaces for the new the code that I'm adding to the file, not for the one that's already present in it.
Would it be possible to have the option to have an auto-format option with a custom set of rules, or where you specify the specific rules yourself?
I don't like to/can't use the auto-format with full PEP-8 style or so, but I would love to have some simple things be automatically corrected on saving, like trailing whitespaces (W291) or blank lines containing whitespace (W293). These are small things that sneak in so easily, and are a waste of time to correct manually.
It could be made just like "Ingore following errors and warnings"-box, except you specify the warnings/errors you want to be corrected.
The text was updated successfully, but these errors were encountered: