FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add PSAvoidUsingNewObject Rule by DrSkillIssue · Pull Request #2109 · PowerShell/PSScriptAnalyzer · GitHub

Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .cs  (2) .md  (1) .ps1  (3) .psd1  (2) .resx  (1) All 5 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
10 changes: 5 additions & 5 deletions Engine/Commands/InvokeScriptAnalyzerCommand.cs

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

please tidy up diff

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -338,11 +338,11 @@ protected override void BeginProcessing()
settingsObj?.CustomRulePath?.ToArray(),
this.SessionState,
combRecurseCustomRulePath);
combRulePaths = rulePaths == null
? settingsCustomRulePath
: settingsCustomRulePath == null
? rulePaths
: rulePaths.Concat(settingsCustomRulePath).ToArray();
combRulePaths = rulePaths == null
? settingsCustomRulePath
: settingsCustomRulePath == null
? rulePaths
: rulePaths.Concat(settingsCustomRulePath).ToArray();
}
catch (Exception exception)
{
Expand Down
1 change: 1 addition & 0 deletions Engine/Settings/PSGallery.psd1

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

this file is to replicate setting used by PSGallery to scan code when users upload new module and send email if there are violations. I don't even know whether this file is still in sync as of today but this file should only be updated by PSGallery members who know the rules used by PSGallery (and consider adding new ones).
Can you comment on whether this file is up to date and if not open separate PR to sync please alerickson ?

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
'PSAvoidGlobalVars',
'PSUseDeclaredVarsMoreThanAssignments',
'PSAvoidUsingInvokeExpression',
'PSAvoidUsingNewObject',
'PSAvoidUsingPlainTextForPassword',
'PSAvoidUsingComputerNameHardcoded',
'PSUsePSCredentialType',
Expand Down
3 changes: 2 additions & 1 deletion Engine/Settings/ScriptFunctions.psd1

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I am not sure what the purpose of this settings file is but until then I'd not recommend touching it please

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
'PSAvoidUsingPositionalParameters',
'PSAvoidGlobalVars',
'PSUseDeclaredVarsMoreThanAssignments',
'PSAvoidUsingInvokeExpression')
'PSAvoidUsingInvokeExpression',
'PSAvoidUsingNewObject')
}
Loading
Loading

Back | FazBrowse Home | New Git URL