Skip to content

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
Rob Holt (rjmholt) merged 1 commit into
PowerShell:masterfrom
bergmeister:autoCorrectAliases
Sep 10, 2019
Merged

Rob Holt (rjmholt) merged 1 commit into
PowerShell:masterfrom
bergmeister:autoCorrectAliases

Conversation

@bergmeister

Copy link
Copy Markdown
Contributor

No description provided.

…) to add support for optionally correcting aliases as well (added in PSSA 1.18.2)
@bergmeister

Christoph Bergmeister (bergmeister) commented Sep 3, 2019 •

Copy link
Copy Markdown
Contributor Author

PoshChan-Bot (@PoshChan) please retry ci (sporadic failure on ubuntu)

@PoshChan

Copy link
Copy Markdown

Christoph Bergmeister (@bergmeister), you are not authorized to request a rebuild

@bergmeister

Christoph Bergmeister (bergmeister) commented Sep 3, 2019 •

Copy link
Copy Markdown
Contributor Author

Steve Lee (@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
Copy Markdown
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
Copy Markdown
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.

@TylerLeonhardt TylerLeonhardt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@rjmholt
Rob Holt (rjmholt) merged commit 061effe into PowerShell:master Sep 10, 2019
Rob Holt (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
Rob Holt (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
Rob Holt (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
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