-
Notifications
You must be signed in to change notification settings - Fork 513
Autoformat setting for all lower case or all upper case keywords #547
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
Comments
I'm with you with this one :) I hate it when keywords scream at me |
It would be nice if we could even add it for operators as well...annoys me to no end to see |
Good idea! |
Please (please!) add Pascal case as an option for keywords too (Foreach, If, etc etc). I realise I'm not in the majority here but it's a style I've used forever and I guess it would be easy to add to the above enhancement (and I'm sure there are other weirdos out there who would like this... :-)) Thanks! |
@ChrisWarwick I would vote for a true PascalCase ( @wsmelton I had no idea people did anything but lowercase operators.. Looks like such a bad design decision on script-writers' parts. |
@bergmeister is this something we could handle in PSSA? |
@tylerl0706 Yes, but it would be a style rule, not a code analysis rule. There is already a similar issue in PSSA that falls into this category: PowerShell/PSScriptAnalyzer#767 |
Thanks, @bergmeister! That's what I thought. I'm going to close this issue in favor of the one in PSSA since this would be addressed there :) |
So will PSSA implement the ability to apply the rule when we format a file? |
@wsmelton The issue is marked as up for grabs, so anyone can feel free to do it. From my side, I think there are bigger fishes to fry, so from my side it is not a priority. I am only the community maintainer of it and I cannot speak for the MSFT side. |
@wsmelton if your question is can PSSA do this, the answer is yes. If it's will the feature be added, refer to @bergmeister's answer ^ |
@tylerl0706 Can you give an answer from the MSFT side whether you guys are interested in that? I already do a lot of community stuff for PSSA but it is just a matter of prioritization since there are more than enough issues to do and some of them are badly affecting users and the reality is simply that there is only a finite number of hours in a day. I am happy to help though if someone wants to tackle it. |
I'm not really spending a lot of time in PSSA - that's more on @JamesWTruher and @kalgiz (when she gets back from vacation). Generally speaking, if there are a lot of thumbs up (👍), we'll likely prioritize it higher. This might go without saying... if you want something really badly, and we don't have the engineering power to do it, pull requests are always welcome 😄 and we have smart folks like @bergmeister and the other two mentioned to help guide folks through the process! |
I'm more concerned with implementation of it. If I open a 350 line script that someone used say PowerShell Studio to develop it. PS Studio can default to doing something like |
@wsmelton The PowerShell extension uses PSSA for all its automatic formatting. So the feature/fix needs to be added to PSSA first, then the PowerShell extension for VSCode will pick it up via a PSSA update. |
I should add that PSSA is consumed indirectly by PowerShellEditorServices, therefore any Editor has theoretically the capability to make use of it. Apart from that the cmdlets by PSSA can be used manually to auto-format one or multiple scripts in one go. |
Feature Request
Loving the new format settings for 0.10.0 release. Would it be possible to add control over case of keywords?
Examples
I add to my settings something like:
That setting would turn this:
into this:
The text was updated successfully, but these errors were encountered: