From 3656986ab85d87f30effc5c417ff7180899c1eb6 Mon Sep 17 00:00:00 2001 From: Christoph Bergmeister Date: Sat, 12 May 2018 00:16:38 +0100 Subject: [PATCH 1/6] Update changelog with latest PRs and run New-Release to bump version and add changelog to psd1 Improve issue link Readme to use new multiple issue template --- CHANGELOG.MD | 9 ++++ Engine/PSScriptAnalyzer.psd1 | 81 ++++++++++++++++++++++++++++++++++-- README.md | 2 +- 3 files changed, 88 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.MD b/CHANGELOG.MD index 463d584e2..81e47f52a 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -15,6 +15,8 @@ ### Fixes and Improvements +- AvoidDefaultValueForMandatoryParameter triggers when the field has specification: Mandatory=value and value!=0 (#969) (by @kalgiz) +- Do not trigger UseDeclaredVarsMoreThanAssignment for variables being used via Get-Variable (#925) (by @bergmeister) - Make UseDeclaredVarsMoreThanAssignments not flag drive qualified variables (#958) (by @bergmeister) - Fix PSUseDeclaredVarsMoreThanAssignments to not give false positives when using += operator (#935) (by @bergmeister) - Tweak UseConsistentWhiteSpace formatting rule to exclude first unary operator when being used in argument (#949) (by @bergmeister) @@ -31,6 +33,8 @@ ### Engine, Building and Testing +- Allow TypeNotFound parser errors (#957) (by @bergmeister) +- Scripts needed to build and sign PSSA via MS VSTS so it can be published in the gallery (#983) (by @JamesWTruher) - Move common test code into AppVeyor module (#961) (by @bergmeister) - Remove extraneous import-module commands in tests (#962) (by @JamesWTruher) - Upgrade 'System.Automation.Management' NuGet package of version 6.0.0-alpha13 to version 6.0.2 from powershell-core feed, which requires upgrade to netstandard2.0. NB: This highly improved behavior on WMF3 but also means that the latest patched version (6.0.2) of PowerShell Core should be used. (#919) by @bergmeister) @@ -47,6 +51,11 @@ ### Documentation, Error Messages and miscellaneous Improvements +- Finalize Release Logs and bump version to 1.17 (#998) (by @bergmeister) +- Docker examples: (#987, #990) (by @bergmeister) +- Use multiple GitHub issue templates for bugs, feature requests and support questions (#986) (by @bergmeister +- Fix table of contents (#980) (by @bergmeister) +- Improve documentation, especially about parameter usage and the settings file (#968) (by @bergmeister) - Add base changelog for 1.17.0 (#967) (by @bergmeister) - Remove outdated about_scriptanalyzer help file (#951) (by @bergmeister) - Fixes a typo and enhances the documentation for the parameters required for script rules (#942) (Thanks @MWL88!) diff --git a/Engine/PSScriptAnalyzer.psd1 b/Engine/PSScriptAnalyzer.psd1 index 75554ffe4..930bbddee 100644 --- a/Engine/PSScriptAnalyzer.psd1 +++ b/Engine/PSScriptAnalyzer.psd1 @@ -11,7 +11,7 @@ Author = 'Microsoft Corporation' RootModule = 'PSScriptAnalyzer.psm1' # Version number of this module. -ModuleVersion = '1.16.1' +ModuleVersion = '1.17.0' # ID used to uniquely identify this module GUID = 'd6245802-193d-4068-a631-8863a4342a18' @@ -87,8 +87,82 @@ PrivateData = @{ ProjectUri = 'https://github.com/PowerShell/PSScriptAnalyzer' IconUri = '' ReleaseNotes = @' -### Fixed -- (#815) Formatter crashes due to invalid extent comparisons +### New Parameters + +- Add `-ReportSummary` switch (#895) (Thanks @StingyJack! for the base work that got finalized by @bergmeister) +- Add `-EnableExit` switch to Invoke-ScriptAnalyzer for exit and return exit code for CI purposes (#842) (by @bergmeister) +- Add `-Fix` switch to `-Path` parameter set of `Invoke-ScriptAnalyzer` (#817, #852) (by @bergmeister) + +### New Rules and Warnings + +- Warn when 'Get-' prefix was omitted in `AvoidAlias` rule. (#927) (by @bergmeister) +- `AvoidAssignmentToAutomaticVariable`. NB: Currently only warns against read-only automatic variables (#864, #917) (by @bergmeister) +- `PossibleIncorrectUsageOfRedirectionOperator` and `PossibleIncorrectUsageOfAssignmentOperator`. (#859, #881) (by @bergmeister) +- Add PSAvoidTrailingWhitespace rule (#820) (Thanks @dlwyatt!) + +### Fixes and Improvements + +- AvoidDefaultValueForMandatoryParameter triggers when the field has specification: Mandatory=value and value!=0 (#969) (by @kalgiz) +- Do not trigger UseDeclaredVarsMoreThanAssignment for variables being used via Get-Variable (#925) (by @bergmeister) +- Make UseDeclaredVarsMoreThanAssignments not flag drive qualified variables (#958) (by @bergmeister) +- Fix PSUseDeclaredVarsMoreThanAssignments to not give false positives when using += operator (#935) (by @bergmeister) +- Tweak UseConsistentWhiteSpace formatting rule to exclude first unary operator when being used in argument (#949) (by @bergmeister) +- Allow -Setting parameter to resolve setting presets as well when object is still a PSObject in BeginProcessing (#928) (by @bergmeister) +- Add macos detection to New-CommandDataFile (#947) (Thanks @GavinEke!) +- Fix PlaceOpenBrace rule correction to take comment at the end of line into account (#929) (by @bergmeister) +- Do not trigger UseShouldProcessForStateChangingFunctions rule for workflows (#923) (by @bergmeister) +- Fix parsing the -Settings object as a path when the path object originates from an expression (#915) (by @bergmeister) +- Allow relative settings path (#909) (by @bergmeister) +- Fix AvoidDefaultValueForMandatoryParameter documentation, rule and tests (#907) (by @bergmeister) +- Fix NullReferenceException in AlignAssignmentStatement rule when CheckHashtable is enabled (#838) (by @bergmeister) +- Fix FixPSUseDeclaredVarsMoreThanAssignments to also detect variables that are strongly typed (#837) (by @bergmeister) +- Fix PSUseDeclaredVarsMoreThanAssignments when variable is assigned more than once to still give a warning (#836) (by @bergmeister) + +### Engine, Building and Testing + +- Allow TypeNotFound parser errors (#957) (by @bergmeister) +- Scripts needed to build and sign PSSA via MS VSTS so it can be published in the gallery (#983) (by @JamesWTruher) +- Move common test code into AppVeyor module (#961) (by @bergmeister) +- Remove extraneous import-module commands in tests (#962) (by @JamesWTruher) +- Upgrade 'System.Automation.Management' NuGet package of version 6.0.0-alpha13 to version 6.0.2 from powershell-core feed, which requires upgrade to netstandard2.0. NB: This highly improved behavior on WMF3 but also means that the latest patched version (6.0.2) of PowerShell Core should be used. (#919) by @bergmeister) +- Add Ubuntu Build+Test to Appveyor CI (#940) (by @bergmeister) +- Add PowerShell Core Build+Test to Appveyor CI (#939) (by @bergmeister) +- Update Newtonsoft.Json NuGet package of Rules project from 9.0.1 to 10.0.3 (#937) (by @bergmeister) +- Fix Pester v4 installation for `Visual Studio 2017` image and use Pester v4 assertion operator syntax (#892) (by @bergmeister) +- Have a single point of reference for the .Net Core SDK version (#885) (by @bergmeister) +- Fix regressions introduced by PR 882 (#891) (by @bergmeister) +- Changes to allow tests to be run outside of CI (#882) (by @JamesWTruher) +- Upgrade platyPS from Version 0.5 to 0.9 (#869) (by @bergmeister) +- Build using .Net Core SDK 2.1.101 targeting `netstandard2.0` and `net451` (#853, #854, #870, #899, #912, #936) (by @bergmeister) +- Add instructions to make a release (#843) (by @kapilmb) + +### Documentation, Error Messages and miscellaneous Improvements + +- Finalize Release Logs and bump version to 1.17 (#998) (by @bergmeister) +- Docker examples: (#987, #990) (by @bergmeister) +- Use multiple GitHub issue templates for bugs, feature requests and support questions (#986) (by @bergmeister +- Fix table of contents (#980) (by @bergmeister) +- Improve documentation, especially about parameter usage and the settings file (#968) (by @bergmeister) +- Add base changelog for 1.17.0 (#967) (by @bergmeister) +- Remove outdated about_scriptanalyzer help file (#951) (by @bergmeister) +- Fixes a typo and enhances the documentation for the parameters required for script rules (#942) (Thanks @MWL88!) +- Remove unused using statements and sort them (#931) (by @bergmeister) +- Make licence headers consistent across all .cs files by using the recommended header of PsCore (#930) (by @bergmeister) +- Update syntax in ReadMe to be the correct one from get-help (#932) by @bergmeister) +- Remove redundant, out of date Readme of RuleDocumentation folder (#918) (by @bergmeister) +- Shorten contribution section in ReadMe and make it more friendly (#911) (by @bergmeister) +- Update from Pester 4.1.1 to 4.3.1 and use new -BeTrue and -BeFalse operators (#906) (by @bergmeister) +- Fix Markdown in ScriptRuleDocumentation.md so it renders correctly on GitHub web site (#898) (Thanks @MWL88!) +- Fix typo in .Description for Measure-RequiresModules (#888) (Thanks @TimCurwick!) +- Use https links where possible (#873) (by @bergmeister) +- Make documentation of AvoidUsingPositionalParameters match the implementation (#867) (by @bergmeister) +- Fix PSAvoidUsingCmdletAliases warnings of internal build/release scripts in root and Utils folder (#872) (by @bergmeister) +- Add simple GitHub Pull Request template based off the one for PowerShell Core (#866) (by @bergmeister) +- Add a simple GitHub issue template based on the one of PowerShell Core. (#865, #884) (by @bergmeister) +- Fix Example 7 in Invoke-ScriptAnalyzer.md (#862) (Thanks @sethvs!) +- Use the typewriter apostrophe instead the typographic apostrophe (#855) (Thanks @alexandear!) +- Add justification to ReadMe (#848) (Thanks @KevinMarquette!) +- Fix typo in README (#845) (Thanks @misterGF!) '@ } } @@ -114,3 +188,4 @@ PrivateData = @{ + diff --git a/README.md b/README.md index 289036619..93017e121 100644 --- a/README.md +++ b/README.md @@ -368,7 +368,7 @@ Contributions are welcome There are many ways to contribute: -1. Open a new bug report, feature request or just ask a question by opening a new issue [here]( https://github.com/PowerShell/PSScriptAnalyzer/issues/new). +1. Open a new bug report, feature request or just ask a question by opening a new issue [here]( https://github.com/PowerShell/PSScriptAnalyzer/issues/new/choose). 2. Participate in the discussions of [issues](https://github.com/PowerShell/PSScriptAnalyzer/issues), [pull requests](https://github.com/PowerShell/PSScriptAnalyzer/pulls) and verify/test fixes or new features. 3. Submit your own fixes or features as a pull request but please discuss it beforehand in an issue if the change is substantial. 4. Submit test cases. From ae328f94049e3615984c9c92ca35788fb1d416e1 Mon Sep 17 00:00:00 2001 From: Christoph Bergmeister Date: Sat, 12 May 2018 00:19:17 +0100 Subject: [PATCH 2/6] bump version in csproj and fix date in release log --- CHANGELOG.MD | 2 +- Engine/Engine.csproj | 2 +- Rules/Rules.csproj | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.MD b/CHANGELOG.MD index 81e47f52a..e5f376c34 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -1,4 +1,4 @@ -## [1.17.0](https://github.com/PowerShell/PSScriptAnalyzer/tree/1.17.0) - 2018-04-27 +## [1.17.0](https://github.com/PowerShell/PSScriptAnalyzer/tree/1.17.0) - 2018-05-14 ### New Parameters diff --git a/Engine/Engine.csproj b/Engine/Engine.csproj index f727116b5..b08d4bc89 100644 --- a/Engine/Engine.csproj +++ b/Engine/Engine.csproj @@ -1,7 +1,7 @@ - 1.16.1 + 1.17.0 netstandard2.0;net451 Microsoft.Windows.PowerShell.ScriptAnalyzer Engine diff --git a/Rules/Rules.csproj b/Rules/Rules.csproj index ddefe13be..f6e13df1d 100644 --- a/Rules/Rules.csproj +++ b/Rules/Rules.csproj @@ -1,7 +1,7 @@ - 1.16.1 + 1.17.0 netstandard2.0;net451 Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules Rules From c6e907ebaddd66573dc3382000aed23b01c5a2dd Mon Sep 17 00:00:00 2001 From: Christoph Bergmeister Date: Tue, 15 May 2018 23:10:53 +0100 Subject: [PATCH 3/6] add choco pr and fix table of contents in readme --- CHANGELOG.MD | 1 + Engine/PSScriptAnalyzer.psd1 | 1 + README.md | 1 + 3 files changed, 3 insertions(+) diff --git a/CHANGELOG.MD b/CHANGELOG.MD index e5f376c34..037e2e829 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -51,6 +51,7 @@ ### Documentation, Error Messages and miscellaneous Improvements +- Added Chocolatey Install help, which has community support (#999) (Thanks @pauby) - Finalize Release Logs and bump version to 1.17 (#998) (by @bergmeister) - Docker examples: (#987, #990) (by @bergmeister) - Use multiple GitHub issue templates for bugs, feature requests and support questions (#986) (by @bergmeister diff --git a/Engine/PSScriptAnalyzer.psd1 b/Engine/PSScriptAnalyzer.psd1 index 930bbddee..b86337da7 100644 --- a/Engine/PSScriptAnalyzer.psd1 +++ b/Engine/PSScriptAnalyzer.psd1 @@ -138,6 +138,7 @@ PrivateData = @{ ### Documentation, Error Messages and miscellaneous Improvements +- Added Chocolatey Install help, which has community support (#999) (Thanks @pauby) - Finalize Release Logs and bump version to 1.17 (#998) (by @bergmeister) - Docker examples: (#987, #990) (by @bergmeister) - Use multiple GitHub issue templates for bugs, feature requests and support questions (#986) (by @bergmeister diff --git a/README.md b/README.md index a20b1c8f4..baff4f0ac 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ Table of Contents - [Requirements](#requirements) - [Steps](#steps) - [Tests](#tests) + + [From Chocolatey](#from-chocolatey) - [Suppressing Rules](#suppressing-rules) - [Settings Support in ScriptAnalyzer](#settings-support-in-scriptanalyzer) * [Built-in Presets](#built-in-presets) From 66b3198e1d3893aeecdf4f616d365e082c7a2763 Mon Sep 17 00:00:00 2001 From: Christoph Bergmeister Date: Thu, 17 May 2018 22:22:58 +0100 Subject: [PATCH 4/6] add new commits --- CHANGELOG.MD | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.MD b/CHANGELOG.MD index 037e2e829..5c9cdf0ae 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -33,7 +33,10 @@ ### Engine, Building and Testing +- Add CommandData files of PowerShell Core 6.0.2 for Windows/Linux/macOS and WMF3/4 that are used by UseCompatibleCmdlets rule (#954) (by @bergmeister) +- If no path is found or when using the -ScriptDefinition parameter set, default to the current location for the directory search of the implicit settings file (#979) (by @bergmeister) - Allow TypeNotFound parser errors (#957) (by @bergmeister) +- Fix release script by building also for v3 and misc. improvements (#996) (by @bergmeister) - Scripts needed to build and sign PSSA via MS VSTS so it can be published in the gallery (#983) (by @JamesWTruher) - Move common test code into AppVeyor module (#961) (by @bergmeister) - Remove extraneous import-module commands in tests (#962) (by @JamesWTruher) From 6be24c4bf5c19aa538edbba001c1ae8e88a2d537 Mon Sep 17 00:00:00 2001 From: Christoph Bergmeister Date: Thu, 17 May 2018 23:02:52 +0100 Subject: [PATCH 5/6] add recent commit --- CHANGELOG.MD | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.MD b/CHANGELOG.MD index 5c9cdf0ae..f36f90c42 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -33,6 +33,7 @@ ### Engine, Building and Testing +- Support `SuggestedCorrections` property on DiagnosticRecord for script based rules #1000 (by @bergmeister) - Add CommandData files of PowerShell Core 6.0.2 for Windows/Linux/macOS and WMF3/4 that are used by UseCompatibleCmdlets rule (#954) (by @bergmeister) - If no path is found or when using the -ScriptDefinition parameter set, default to the current location for the directory search of the implicit settings file (#979) (by @bergmeister) - Allow TypeNotFound parser errors (#957) (by @bergmeister) From e85cb9bd6eb543818b835de9e42ec6600a132564 Mon Sep 17 00:00:00 2001 From: Christoph Bergmeister Date: Fri, 18 May 2018 23:41:28 +0100 Subject: [PATCH 6/6] Update PR number --- CHANGELOG.MD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.MD b/CHANGELOG.MD index f36f90c42..0bde69d44 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -56,7 +56,7 @@ ### Documentation, Error Messages and miscellaneous Improvements - Added Chocolatey Install help, which has community support (#999) (Thanks @pauby) -- Finalize Release Logs and bump version to 1.17 (#998) (by @bergmeister) +- Finalize Release Logs and bump version to 1.17 (#1002) (by @bergmeister) - Docker examples: (#987, #990) (by @bergmeister) - Use multiple GitHub issue templates for bugs, feature requests and support questions (#986) (by @bergmeister - Fix table of contents (#980) (by @bergmeister)