Skip to content
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

Add AutoCorrectAliases setting (PR to be made in VS-Code repo as well) to add support for optionally correcting aliases as well (added in PSSA 1.18.2) #1021

Merged
merged 1 commit into from
Sep 10, 2019

Conversation

bergmeister
Copy link
Contributor

No description provided.

…) to add support for optionally correcting aliases as well (added in PSSA 1.18.2)
@bergmeister bergmeister requested a review from rjmholt as a code owner September 3, 2019 22:53
bergmeister added a commit to bergmeister/vscode-powershell that referenced this pull request Sep 3, 2019
…rt for optionally correcting aliases as well (added in PSSA 1.18.2). Disabled by default.

Requires the following PSES PR to be merged first: PowerShell/PowerShellEditorServices#1021
@bergmeister
Copy link
Contributor Author

bergmeister commented Sep 3, 2019

@PoshChan please retry ci (sporadic failure on ubuntu)

@PoshChan
Copy link

PoshChan commented Sep 3, 2019

@bergmeister, you are not authorized to request a rebuild

@bergmeister
Copy link
Contributor Author

bergmeister commented Sep 3, 2019

@SteveL-MSFT Although I am in the file of authorized poshchan users here, I do not seem to be able to request a retry (see above). Or does the JSON file mean I have only permission to ask to retry as specific test but not the a whole CI build?

};
if (AutoCorrectAliases)
{
ruleConfigurations.Add("PSAvoidUsingCmdletAliases", new Hashtable());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current pattern seems to always include the rule entry and set Enable to the boolean given. Is there a reason that shouldn't be done here?

Also, does this need to set Enable = true in the hashtable body?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PSAvoidUsingCmdletAliases is a script analysis rule that inherits only from IScriptRule (see here). Formatting rules typically inherit from ConfigurableRule, which is what makes them have the Enable property. This is just the API of this specific rule, therefore although it would be nice to have them all consistent, I don't think we could even change that in PSSA without breaking people that use the PSAvoidUsingCmdletAliases for code analysis in their setting files.

Copy link
Member

@TylerLeonhardt TylerLeonhardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rjmholt rjmholt merged commit 061effe into PowerShell:master Sep 10, 2019
rjmholt pushed a commit to PowerShell/vscode-powershell that referenced this pull request Sep 10, 2019
…rt for optionally correcting aliases as well (added in PSSA 1.18.2). Disabled by default. (#2165)

Requires the following PSES PR to be merged first: PowerShell/PowerShellEditorServices#1021
rjmholt pushed a commit to rjmholt/vscode-powershell that referenced this pull request Sep 10, 2019
…rt for optionally correcting aliases as well (added in PSSA 1.18.2). Disabled by default. (PowerShell#2165)

Requires the following PSES PR to be merged first: PowerShell/PowerShellEditorServices#1021
rjmholt pushed a commit to rjmholt/PowerShellEditorServices that referenced this pull request Sep 10, 2019
…) to add support for optionally correcting aliases as well (added in PSSA 1.18.2) (PowerShell#1021)
TylerLeonhardt pushed a commit to PowerShell/vscode-powershell that referenced this pull request Sep 17, 2019
…rt for optionally correcting aliases as well (added in PSSA 1.18.2). Disabled by default. (#2165) (#2172)

Requires the following PSES PR to be merged first: PowerShell/PowerShellEditorServices#1021
TylerLeonhardt pushed a commit that referenced this pull request Sep 17, 2019
* Add AutoCorrectAliases setting (PR to be made in VS-Code repo as well) to add support for optionally correcting aliases as well (added in PSSA 1.18.2) (#1021)

* Update PSSA version
@rjmholt rjmholt mentioned this pull request Oct 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants