-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
331 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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 |
---|---|---|
@@ -1 +1,8 @@ | ||
Sample scripts from: https://adamtheautomator.com/powershell-script-examples/ | ||
Sample scripts from: https://adamtheautomator.com/powershell-script-examples/ | ||
|
||
# Getting started | ||
|
||
- Install sonar-ps plugin into SonarQube by copying jar from https://github.com/gretard/sonar-ps-plugin/releases into sonar ./downloads folder | ||
- Restart sonar server | ||
- Download scanner from https://docs.sonarsource.com/sonarqube/9.9/analyzing-source-code/scanners/sonarscanner/ | ||
- Execute : ```sonar-scanner.bat -D"sonar.login=admin" -D"sonar.password=<<PASSWORD>>"``` |
This file contains 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
279 changes: 279 additions & 0 deletions
279
sonar-ps-plugin/src/main/resources/powershell-profile.xml
This file contains 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 |
---|---|---|
@@ -0,0 +1,279 @@ | ||
<?xml version="1.0"?> | ||
<profile> | ||
<name>Sonar way</name> | ||
<language>ps</language> | ||
<rules> | ||
<rule> | ||
<key>PSAlignAssignmentStatement</key> | ||
<repositoryKey>ps-psanalyzer</repositoryKey> | ||
</rule> | ||
<rule> | ||
<key>PSAvoidUsingCmdletAliases</key> | ||
<repositoryKey>ps-psanalyzer</repositoryKey> | ||
</rule> | ||
<rule> | ||
<key>PSAvoidAssignmentToAutomaticVariable</key> | ||
<repositoryKey>ps-psanalyzer</repositoryKey> | ||
</rule> | ||
<rule> | ||
<key>PSAvoidDefaultValueSwitchParameter</key> | ||
<repositoryKey>ps-psanalyzer</repositoryKey> | ||
</rule> | ||
<rule> | ||
<key>PSAvoidDefaultValueForMandatoryParameter</key> | ||
<repositoryKey>ps-psanalyzer</repositoryKey> | ||
</rule> | ||
<rule> | ||
<key>PSAvoidUsingEmptyCatchBlock</key> | ||
<repositoryKey>ps-psanalyzer</repositoryKey> | ||
</rule> | ||
<rule> | ||
<key>PSAvoidGlobalAliases</key> | ||
<repositoryKey>ps-psanalyzer</repositoryKey> | ||
</rule> | ||
<rule> | ||
<key>PSAvoidGlobalFunctions</key> | ||
<repositoryKey>ps-psanalyzer</repositoryKey> | ||
</rule> | ||
<rule> | ||
<key>PSAvoidGlobalVars</key> | ||
<repositoryKey>ps-psanalyzer</repositoryKey> | ||
</rule> | ||
<rule> | ||
<key>PSAvoidInvokingEmptyMembers</key> | ||
<repositoryKey>ps-psanalyzer</repositoryKey> | ||
</rule> | ||
<rule> | ||
<key>PSAvoidLongLines</key> | ||
<repositoryKey>ps-psanalyzer</repositoryKey> | ||
</rule> | ||
<rule> | ||
<key>PSAvoidMultipleTypeAttributes</key> | ||
<repositoryKey>ps-psanalyzer</repositoryKey> | ||
</rule> | ||
<rule> | ||
<key>PSAvoidNullOrEmptyHelpMessageAttribute</key> | ||
<repositoryKey>ps-psanalyzer</repositoryKey> | ||
</rule> | ||
<rule> | ||
<key>PSAvoidOverwritingBuiltInCmdlets</key> | ||
<repositoryKey>ps-psanalyzer</repositoryKey> | ||
</rule> | ||
<rule> | ||
<key>PSAvoidUsingPositionalParameters</key> | ||
<repositoryKey>ps-psanalyzer</repositoryKey> | ||
</rule> | ||
<rule> | ||
<key>PSReservedCmdletChar</key> | ||
<repositoryKey>ps-psanalyzer</repositoryKey> | ||
</rule> | ||
<rule> | ||
<key>PSReservedParams</key> | ||
<repositoryKey>ps-psanalyzer</repositoryKey> | ||
</rule> | ||
<rule> | ||
<key>PSAvoidSemicolonsAsLineTerminators</key> | ||
<repositoryKey>ps-psanalyzer</repositoryKey> | ||
</rule> | ||
<rule> | ||
<key>PSAvoidShouldContinueWithoutForce</key> | ||
<repositoryKey>ps-psanalyzer</repositoryKey> | ||
</rule> | ||
<rule> | ||
<key>PSAvoidTrailingWhitespace</key> | ||
<repositoryKey>ps-psanalyzer</repositoryKey> | ||
</rule> | ||
<rule> | ||
<key>PSAvoidUsingUsernameAndPasswordParams</key> | ||
<repositoryKey>ps-psanalyzer</repositoryKey> | ||
</rule> | ||
<rule> | ||
<key>PSAvoidUsingBrokenHashAlgorithms</key> | ||
<repositoryKey>ps-psanalyzer</repositoryKey> | ||
</rule> | ||
<rule> | ||
<key>PSAvoidUsingComputerNameHardcoded</key> | ||
<repositoryKey>ps-psanalyzer</repositoryKey> | ||
</rule> | ||
<rule> | ||
<key>PSAvoidUsingConvertToSecureStringWithPlainText</key> | ||
<repositoryKey>ps-psanalyzer</repositoryKey> | ||
</rule> | ||
<rule> | ||
<key>PSAvoidUsingDeprecatedManifestFields</key> | ||
<repositoryKey>ps-psanalyzer</repositoryKey> | ||
</rule> | ||
<rule> | ||
<key>PSAvoidUsingDoubleQuotesForConstantString</key> | ||
<repositoryKey>ps-psanalyzer</repositoryKey> | ||
</rule> | ||
<rule> | ||
<key>PSAvoidUsingInvokeExpression</key> | ||
<repositoryKey>ps-psanalyzer</repositoryKey> | ||
</rule> | ||
<rule> | ||
<key>PSAvoidUsingPlainTextForPassword</key> | ||
<repositoryKey>ps-psanalyzer</repositoryKey> | ||
</rule> | ||
<rule> | ||
<key>PSAvoidUsingWMICmdlet</key> | ||
<repositoryKey>ps-psanalyzer</repositoryKey> | ||
</rule> | ||
<rule> | ||
<key>PSAvoidUsingWriteHost</key> | ||
<repositoryKey>ps-psanalyzer</repositoryKey> | ||
</rule> | ||
<rule> | ||
<key>PSUseCompatibleCommands</key> | ||
<repositoryKey>ps-psanalyzer</repositoryKey> | ||
</rule> | ||
<rule> | ||
<key>PSUseCompatibleSyntax</key> | ||
<repositoryKey>ps-psanalyzer</repositoryKey> | ||
</rule> | ||
<rule> | ||
<key>PSUseCompatibleTypes</key> | ||
<repositoryKey>ps-psanalyzer</repositoryKey> | ||
</rule> | ||
<rule> | ||
<key>PSMisleadingBacktick</key> | ||
<repositoryKey>ps-psanalyzer</repositoryKey> | ||
</rule> | ||
<rule> | ||
<key>PSMissingModuleManifestField</key> | ||
<repositoryKey>ps-psanalyzer</repositoryKey> | ||
</rule> | ||
<rule> | ||
<key>PSPlaceCloseBrace</key> | ||
<repositoryKey>ps-psanalyzer</repositoryKey> | ||
</rule> | ||
<rule> | ||
<key>PSPlaceOpenBrace</key> | ||
<repositoryKey>ps-psanalyzer</repositoryKey> | ||
</rule> | ||
<rule> | ||
<key>PSPossibleIncorrectComparisonWithNull</key> | ||
<repositoryKey>ps-psanalyzer</repositoryKey> | ||
</rule> | ||
<rule> | ||
<key>PSPossibleIncorrectUsageOfAssignmentOperator</key> | ||
<repositoryKey>ps-psanalyzer</repositoryKey> | ||
</rule> | ||
<rule> | ||
<key>PSPossibleIncorrectUsageOfRedirectionOperator</key> | ||
<repositoryKey>ps-psanalyzer</repositoryKey> | ||
</rule> | ||
<rule> | ||
<key>PSProvideCommentHelp</key> | ||
<repositoryKey>ps-psanalyzer</repositoryKey> | ||
</rule> | ||
<rule> | ||
<key>PSReviewUnusedParameter</key> | ||
<repositoryKey>ps-psanalyzer</repositoryKey> | ||
</rule> | ||
<rule> | ||
<key>PSUseApprovedVerbs</key> | ||
<repositoryKey>ps-psanalyzer</repositoryKey> | ||
</rule> | ||
<rule> | ||
<key>PSUseBOMForUnicodeEncodedFile</key> | ||
<repositoryKey>ps-psanalyzer</repositoryKey> | ||
</rule> | ||
<rule> | ||
<key>PSUseCmdletCorrectly</key> | ||
<repositoryKey>ps-psanalyzer</repositoryKey> | ||
</rule> | ||
<rule> | ||
<key>PSUseCompatibleCmdlets</key> | ||
<repositoryKey>ps-psanalyzer</repositoryKey> | ||
</rule> | ||
<rule> | ||
<key>PSUseConsistentIndentation</key> | ||
<repositoryKey>ps-psanalyzer</repositoryKey> | ||
</rule> | ||
<rule> | ||
<key>PSUseConsistentWhitespace</key> | ||
<repositoryKey>ps-psanalyzer</repositoryKey> | ||
</rule> | ||
<rule> | ||
<key>PSUseCorrectCasing</key> | ||
<repositoryKey>ps-psanalyzer</repositoryKey> | ||
</rule> | ||
<rule> | ||
<key>PSUseDeclaredVarsMoreThanAssignments</key> | ||
<repositoryKey>ps-psanalyzer</repositoryKey> | ||
</rule> | ||
<rule> | ||
<key>PSUseLiteralInitializerForHashtable</key> | ||
<repositoryKey>ps-psanalyzer</repositoryKey> | ||
</rule> | ||
<rule> | ||
<key>PSUseOutputTypeCorrectly</key> | ||
<repositoryKey>ps-psanalyzer</repositoryKey> | ||
</rule> | ||
<rule> | ||
<key>PSUseProcessBlockForPipelineCommand</key> | ||
<repositoryKey>ps-psanalyzer</repositoryKey> | ||
</rule> | ||
<rule> | ||
<key>PSUsePSCredentialType</key> | ||
<repositoryKey>ps-psanalyzer</repositoryKey> | ||
</rule> | ||
<rule> | ||
<key>PSShouldProcess</key> | ||
<repositoryKey>ps-psanalyzer</repositoryKey> | ||
</rule> | ||
<rule> | ||
<key>PSUseShouldProcessForStateChangingFunctions</key> | ||
<repositoryKey>ps-psanalyzer</repositoryKey> | ||
</rule> | ||
<rule> | ||
<key>PSUseSingularNouns</key> | ||
<repositoryKey>ps-psanalyzer</repositoryKey> | ||
</rule> | ||
<rule> | ||
<key>PSUseSupportsShouldProcess</key> | ||
<repositoryKey>ps-psanalyzer</repositoryKey> | ||
</rule> | ||
<rule> | ||
<key>PSUseToExportFieldsInManifest</key> | ||
<repositoryKey>ps-psanalyzer</repositoryKey> | ||
</rule> | ||
<rule> | ||
<key>PSUseUsingScopeModifierInNewRunspaces</key> | ||
<repositoryKey>ps-psanalyzer</repositoryKey> | ||
</rule> | ||
<rule> | ||
<key>PSUseUTF8EncodingForHelpFile</key> | ||
<repositoryKey>ps-psanalyzer</repositoryKey> | ||
</rule> | ||
<rule> | ||
<key>PSDSCDscExamplesPresent</key> | ||
<repositoryKey>ps-psanalyzer</repositoryKey> | ||
</rule> | ||
<rule> | ||
<key>PSDSCDscTestsPresent</key> | ||
<repositoryKey>ps-psanalyzer</repositoryKey> | ||
</rule> | ||
<rule> | ||
<key>PSDSCReturnCorrectTypesForDSCFunctions</key> | ||
<repositoryKey>ps-psanalyzer</repositoryKey> | ||
</rule> | ||
<rule> | ||
<key>PSDSCUseIdenticalMandatoryParametersForDSC</key> | ||
<repositoryKey>ps-psanalyzer</repositoryKey> | ||
</rule> | ||
<rule> | ||
<key>PSDSCUseIdenticalParametersForDSC</key> | ||
<repositoryKey>ps-psanalyzer</repositoryKey> | ||
</rule> | ||
<rule> | ||
<key>PSDSCStandardDSCFunctionsInResource</key> | ||
<repositoryKey>ps-psanalyzer</repositoryKey> | ||
</rule> | ||
<rule> | ||
<key>PSDSCUseVerboseMessageInDSCResource</key> | ||
<repositoryKey>ps-psanalyzer</repositoryKey> | ||
</rule> | ||
</rules> | ||
</profile> |
This file contains 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