From ba9ff14a9c37b0aa77326ac68357d14169cf742d Mon Sep 17 00:00:00 2001 From: James Truher Date: Thu, 19 Aug 2021 09:00:30 -0700 Subject: [PATCH 01/16] start changelog for 1.20.0 release --- CHANGELOG.MD | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/CHANGELOG.MD b/CHANGELOG.MD index 0bdf21cb6..32d202ef4 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -1,5 +1,19 @@ # CHANGELOG +## [1.20.0](https://github.com/PowerShell/PSScriptAnalyzer/tree/1.20.0) - 2021-08-xx + +### Fixes + +### New Rule + +### Miscellaneous + +### Documentation + +### Testing + +### Development Improvements + ## [1.19.1](https://github.com/PowerShell/PSScriptAnalyzer/tree/1.19.1) - 2020-07-28 ### Fixes From 6194d002b0c60ad39597089bd885165bc94b67da Mon Sep 17 00:00:00 2001 From: James Truher Date: Thu, 19 Aug 2021 21:51:46 -0700 Subject: [PATCH 02/16] first draft of changelog for 1.20.0 --- CHANGELOG.MD | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 61 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.MD b/CHANGELOG.MD index 32d202ef4..20766ddc7 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -1,18 +1,77 @@ # CHANGELOG -## [1.20.0](https://github.com/PowerShell/PSScriptAnalyzer/tree/1.20.0) - 2021-08-xx +## [1.20.0](https://github.com/PowerShell/PSScriptAnalyzer/tree/1.20.0) - 2021-08-20 ### Fixes +- Replace red-herring warning around process aliasing get-process with warning around invalid syntax (#1638) (by @bergmeister) +- Fix FunctionInfo fallback AST attribute analysis for UseShouldProcessCorrectly (#1659) (thanks @hubuk) +- Do not increase indentation after LParen if the previous token is a Newline and the next token is not a Newline (#1469) (by @bergmeister) +- UseConsistenWhitespace - CheckOpenBrace setting: Do not warn when being preceded by open parenthesis (#1633) (by @bergmeister) + ### New Rule +- Make UseSingularNouns rule work on PowerShell Core (#1627) (by @bergmeister) + +- UseConsistentWhitespace - Create option to ignore assignment operator inside hash table (#1566) (thanks @daviesj) + * UseConsistentWhitespace - Create option to ignore assignment operator inside hash table + * Undo whitespace changes to settings files + * Begin implementation of visitor to find token in AST + * Fleshed out FindAstPositionVistor and fixed test + * Make visitor internal + * correct spelling + * fix off-by-one error in visitor + * Simplify code in visitor + * Move private method to the bottom & small summary correction (leaf => leaf-most) + ### Miscellaneous +- Implement -IncludeSuppressions parameter (#1701) (by @rjmholt) +- Combine multiple suppressions applied to the same diagnostic (#1699) (by @rjmholt) + * Ensure multiply suppressed diagnostics only create one output + * Add extra tests + * Use other API to get suppression attribute types +- Use dependabot to keep dependencies up to date (#1664) (by @rjmholt) +- Add reviewers and explicit dependency exclusions to dependabot (#1676) (by @rjmholt) +- Remove explicit registries in dependabot (#1671) (by @rjmholt) + ### Documentation +- Link to the rules from the readme (#1642) (thanks @bbodenmiller) +- Add HelpInfoUri (#1651) (by @sdwheeler) +- Add documentation around CustomRulePath in Settings file to README.md (#1636) (thanks @johlju) + * Add documentation CustomRulePath in README.md + * Fix table of contents +- Use allowlist and blocklist terminology, supply alternate configuration key for PSAvoidUsingCmdletAliases (#1604) (by @bergmeister) +- Fix suppression example errors in README (#1593) (by @rjmholt) +- Fix AvoidLongLines documentation example (#1554) (thanks @floh96) +- Remove broken waffle.io links from readme.md (#1558) (thanks @clcaldwell) +- Fix typo in AvoidUsingCmdletAliases documentation (#1590) (thanks @rubengonzalez-dev) + ### Testing -### Development Improvements +- Fix compatibility rule tests (#1697) (by @rjmholt) +- Fix missing space in AvoidPositionalParameter test asset (#1573) (by @jameswtruher) + +### Development/Build Improvements + +- Fix build module tests (#1654) (thanks @clcaldwell) +- Move to new signing process for release build and prep for 1.20.0 (#1625) (by @jameswtruher) +- Handle cases where the Signature generator fails catastrophically (#1661) (by @jameswtruher) +- Update .Net SDK to 3.1.408 (#1630) (by @bergmeister) +- Simplify devcontainer setup and resolve git line ending conflicts (#1637) (by @bergmeister) +- Speedup CI by bootstrapping PowerShell module installations in background and in parallel, whilst the .NET SDK is being installed (#1634) (by @bergmeister) +- Upgrade release Dockerfile from Ubuntu 16.04 to 20.04 (#1631) (by @bergmeister) +- Remove old powershell-core NuGet feed, which sometimes causes build failures (#1632) (by @bergmeister) +- Remove reference to myget.org as a package resource (#1640) (by @jameswtruher) +- Add Ubuntu 20.04 to build matrix (#1628) (by @bergmeister) +- Remove conditional compilation for PSv6 and therefore netstandard2.0 for Engine and Rules projects (#1600) (by @bergmeister) +- Upgrade Microsoft.CSharp, Microsoft.Win32.Registry and System.Reflection.TypeExtensions from 4.5.0 to 4.7.0 (#1599) (by @bergmeister) +- Use PowerShell preview extension for Github Codespaces (#1596) (by @bergmeister) +- Update SMA reference for netcoreapp3.1 to from 7.0.0 to 7.0.3 (#1597) (by @bergmeister) +- 🧹 Make usage of Microsoft.Management.Infrastructure consistent and reference it only once in CrossCompatibility project (#1601) (by @bergmeister) +- Update launch.json (#1603) (by @bergmeister) +- Make CI fail if tests fail and fix failing tests by making them Pester v5 compatible (#1553) (coauthored by @bergmeister) ## [1.19.1](https://github.com/PowerShell/PSScriptAnalyzer/tree/1.19.1) - 2020-07-28 From 0619c608e679d4e2206298258a7183669fdde9f5 Mon Sep 17 00:00:00 2001 From: "James Truher [MSFT]" Date: Mon, 23 Aug 2021 08:49:01 -0700 Subject: [PATCH 03/16] Update CHANGELOG.MD Co-authored-by: Robert Holt --- CHANGELOG.MD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.MD b/CHANGELOG.MD index 20766ddc7..0363ee486 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -4,7 +4,7 @@ ### Fixes -- Replace red-herring warning around process aliasing get-process with warning around invalid syntax (#1638) (by @bergmeister) +- Replace unhelpful warning around `process` aliasing `Get-Process` with warning about misused syntax (#1638) (by @bergmeister) - Fix FunctionInfo fallback AST attribute analysis for UseShouldProcessCorrectly (#1659) (thanks @hubuk) - Do not increase indentation after LParen if the previous token is a Newline and the next token is not a Newline (#1469) (by @bergmeister) - UseConsistenWhitespace - CheckOpenBrace setting: Do not warn when being preceded by open parenthesis (#1633) (by @bergmeister) From 7cd75f5a0f4974cfa973284577f56a1a940d5657 Mon Sep 17 00:00:00 2001 From: "James Truher [MSFT]" Date: Mon, 23 Aug 2021 08:49:11 -0700 Subject: [PATCH 04/16] Update CHANGELOG.MD Co-authored-by: Robert Holt --- CHANGELOG.MD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.MD b/CHANGELOG.MD index 0363ee486..65b8ac2fe 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -5,7 +5,7 @@ ### Fixes - Replace unhelpful warning around `process` aliasing `Get-Process` with warning about misused syntax (#1638) (by @bergmeister) -- Fix FunctionInfo fallback AST attribute analysis for UseShouldProcessCorrectly (#1659) (thanks @hubuk) +- Fix `FunctionInfo` fallback AST attribute analysis for UseShouldProcessCorrectly (#1659) (thanks @hubuk) - Do not increase indentation after LParen if the previous token is a Newline and the next token is not a Newline (#1469) (by @bergmeister) - UseConsistenWhitespace - CheckOpenBrace setting: Do not warn when being preceded by open parenthesis (#1633) (by @bergmeister) From a9c3667ad833f95fd5ad5cb81d0b11aad7feccf0 Mon Sep 17 00:00:00 2001 From: "James Truher [MSFT]" Date: Mon, 23 Aug 2021 08:49:20 -0700 Subject: [PATCH 05/16] Update CHANGELOG.MD Co-authored-by: Robert Holt --- CHANGELOG.MD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.MD b/CHANGELOG.MD index 65b8ac2fe..735b9761e 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -6,7 +6,7 @@ - Replace unhelpful warning around `process` aliasing `Get-Process` with warning about misused syntax (#1638) (by @bergmeister) - Fix `FunctionInfo` fallback AST attribute analysis for UseShouldProcessCorrectly (#1659) (thanks @hubuk) -- Do not increase indentation after LParen if the previous token is a Newline and the next token is not a Newline (#1469) (by @bergmeister) +- Do not increase indentation after a left parenthesis if the previous token is a newline and the next token is not a newline (#1469) (by @bergmeister) - UseConsistenWhitespace - CheckOpenBrace setting: Do not warn when being preceded by open parenthesis (#1633) (by @bergmeister) ### New Rule From d34e0c2407df4fabbc1ab16b1a2af0b60a954052 Mon Sep 17 00:00:00 2001 From: "James Truher [MSFT]" Date: Mon, 23 Aug 2021 08:49:29 -0700 Subject: [PATCH 06/16] Update CHANGELOG.MD Co-authored-by: Robert Holt --- CHANGELOG.MD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.MD b/CHANGELOG.MD index 735b9761e..edd615875 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -11,7 +11,7 @@ ### New Rule -- Make UseSingularNouns rule work on PowerShell Core (#1627) (by @bergmeister) +- Make UseSingularNouns rule work in PowerShell 7 (#1627) (by @bergmeister) - UseConsistentWhitespace - Create option to ignore assignment operator inside hash table (#1566) (thanks @daviesj) * UseConsistentWhitespace - Create option to ignore assignment operator inside hash table From 1a00824ae60cf76eb1e7bc167bfc36d2f262a281 Mon Sep 17 00:00:00 2001 From: "James Truher [MSFT]" Date: Mon, 23 Aug 2021 08:49:39 -0700 Subject: [PATCH 07/16] Update CHANGELOG.MD Co-authored-by: Robert Holt --- CHANGELOG.MD | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/CHANGELOG.MD b/CHANGELOG.MD index edd615875..d24a09a8f 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -13,16 +13,7 @@ - Make UseSingularNouns rule work in PowerShell 7 (#1627) (by @bergmeister) -- UseConsistentWhitespace - Create option to ignore assignment operator inside hash table (#1566) (thanks @daviesj) - * UseConsistentWhitespace - Create option to ignore assignment operator inside hash table - * Undo whitespace changes to settings files - * Begin implementation of visitor to find token in AST - * Fleshed out FindAstPositionVistor and fixed test - * Make visitor internal - * correct spelling - * fix off-by-one error in visitor - * Simplify code in visitor - * Move private method to the bottom & small summary correction (leaf => leaf-most) +- UseConsistentWhitespace: Create option to ignore assignment operator inside hashtable (#1566) (thanks @daviesj) ### Miscellaneous From b78c29d6b83e7706e9f767a60db2e042b65df0d2 Mon Sep 17 00:00:00 2001 From: "James Truher [MSFT]" Date: Mon, 23 Aug 2021 08:49:48 -0700 Subject: [PATCH 08/16] Update CHANGELOG.MD Co-authored-by: Robert Holt --- CHANGELOG.MD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.MD b/CHANGELOG.MD index d24a09a8f..6bd71f7be 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -29,7 +29,7 @@ ### Documentation - Link to the rules from the readme (#1642) (thanks @bbodenmiller) -- Add HelpInfoUri (#1651) (by @sdwheeler) +- Add HelpInfoUri to module manifest (#1651) (by @sdwheeler) - Add documentation around CustomRulePath in Settings file to README.md (#1636) (thanks @johlju) * Add documentation CustomRulePath in README.md * Fix table of contents From 1c3105f3a13cbc6750417290215469540ab35c2a Mon Sep 17 00:00:00 2001 From: "James Truher [MSFT]" Date: Mon, 23 Aug 2021 08:49:58 -0700 Subject: [PATCH 09/16] Update CHANGELOG.MD Co-authored-by: Robert Holt --- CHANGELOG.MD | 2 -- 1 file changed, 2 deletions(-) diff --git a/CHANGELOG.MD b/CHANGELOG.MD index 6bd71f7be..d608c7622 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -31,8 +31,6 @@ - Link to the rules from the readme (#1642) (thanks @bbodenmiller) - Add HelpInfoUri to module manifest (#1651) (by @sdwheeler) - Add documentation around CustomRulePath in Settings file to README.md (#1636) (thanks @johlju) - * Add documentation CustomRulePath in README.md - * Fix table of contents - Use allowlist and blocklist terminology, supply alternate configuration key for PSAvoidUsingCmdletAliases (#1604) (by @bergmeister) - Fix suppression example errors in README (#1593) (by @rjmholt) - Fix AvoidLongLines documentation example (#1554) (thanks @floh96) From 07fcc0b5e93008e74728b4030b8ca555db71b7f1 Mon Sep 17 00:00:00 2001 From: "James Truher [MSFT]" Date: Mon, 23 Aug 2021 08:50:04 -0700 Subject: [PATCH 10/16] Update CHANGELOG.MD Co-authored-by: Robert Holt --- CHANGELOG.MD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.MD b/CHANGELOG.MD index d608c7622..2a2abda04 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -46,7 +46,7 @@ - Fix build module tests (#1654) (thanks @clcaldwell) - Move to new signing process for release build and prep for 1.20.0 (#1625) (by @jameswtruher) -- Handle cases where the Signature generator fails catastrophically (#1661) (by @jameswtruher) +- Handle cases where the signature generator fails (#1661) (by @jameswtruher) - Update .Net SDK to 3.1.408 (#1630) (by @bergmeister) - Simplify devcontainer setup and resolve git line ending conflicts (#1637) (by @bergmeister) - Speedup CI by bootstrapping PowerShell module installations in background and in parallel, whilst the .NET SDK is being installed (#1634) (by @bergmeister) From c1736cac3619db831fdf07925d8a4f38b98352b8 Mon Sep 17 00:00:00 2001 From: "James Truher [MSFT]" Date: Mon, 23 Aug 2021 08:50:11 -0700 Subject: [PATCH 11/16] Update CHANGELOG.MD Co-authored-by: Robert Holt --- CHANGELOG.MD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.MD b/CHANGELOG.MD index 2a2abda04..a2b9a7c64 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -47,7 +47,7 @@ - Fix build module tests (#1654) (thanks @clcaldwell) - Move to new signing process for release build and prep for 1.20.0 (#1625) (by @jameswtruher) - Handle cases where the signature generator fails (#1661) (by @jameswtruher) -- Update .Net SDK to 3.1.408 (#1630) (by @bergmeister) +- Update .NET SDK to 3.1.408 (#1630) (by @bergmeister) - Simplify devcontainer setup and resolve git line ending conflicts (#1637) (by @bergmeister) - Speedup CI by bootstrapping PowerShell module installations in background and in parallel, whilst the .NET SDK is being installed (#1634) (by @bergmeister) - Upgrade release Dockerfile from Ubuntu 16.04 to 20.04 (#1631) (by @bergmeister) From f72f9cca494afb28aa8205534790b61a125aedfa Mon Sep 17 00:00:00 2001 From: "James Truher [MSFT]" Date: Mon, 23 Aug 2021 08:50:17 -0700 Subject: [PATCH 12/16] Update CHANGELOG.MD Co-authored-by: Robert Holt --- CHANGELOG.MD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.MD b/CHANGELOG.MD index a2b9a7c64..68f62f282 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -54,7 +54,7 @@ - Remove old powershell-core NuGet feed, which sometimes causes build failures (#1632) (by @bergmeister) - Remove reference to myget.org as a package resource (#1640) (by @jameswtruher) - Add Ubuntu 20.04 to build matrix (#1628) (by @bergmeister) -- Remove conditional compilation for PSv6 and therefore netstandard2.0 for Engine and Rules projects (#1600) (by @bergmeister) +- Remove conditional compilation for PSv6/netstandard2.0 for Engine and Rules projects (#1600) (by @bergmeister) - Upgrade Microsoft.CSharp, Microsoft.Win32.Registry and System.Reflection.TypeExtensions from 4.5.0 to 4.7.0 (#1599) (by @bergmeister) - Use PowerShell preview extension for Github Codespaces (#1596) (by @bergmeister) - Update SMA reference for netcoreapp3.1 to from 7.0.0 to 7.0.3 (#1597) (by @bergmeister) From 5c7995d1cb9593f77b03390f46a90abfe5007696 Mon Sep 17 00:00:00 2001 From: "James Truher [MSFT]" Date: Mon, 23 Aug 2021 08:50:34 -0700 Subject: [PATCH 13/16] Update CHANGELOG.MD Co-authored-by: Robert Holt --- CHANGELOG.MD | 3 --- 1 file changed, 3 deletions(-) diff --git a/CHANGELOG.MD b/CHANGELOG.MD index 68f62f282..88397ff2d 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -19,9 +19,6 @@ - Implement -IncludeSuppressions parameter (#1701) (by @rjmholt) - Combine multiple suppressions applied to the same diagnostic (#1699) (by @rjmholt) - * Ensure multiply suppressed diagnostics only create one output - * Add extra tests - * Use other API to get suppression attribute types - Use dependabot to keep dependencies up to date (#1664) (by @rjmholt) - Add reviewers and explicit dependency exclusions to dependabot (#1676) (by @rjmholt) - Remove explicit registries in dependabot (#1671) (by @rjmholt) From 8bc34ac5d2e9fb980e375d867905942808cd7192 Mon Sep 17 00:00:00 2001 From: "James Truher [MSFT]" Date: Mon, 23 Aug 2021 08:50:45 -0700 Subject: [PATCH 14/16] Update CHANGELOG.MD Co-authored-by: Robert Holt --- CHANGELOG.MD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.MD b/CHANGELOG.MD index 88397ff2d..86c6b6085 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -25,7 +25,7 @@ ### Documentation -- Link to the rules from the readme (#1642) (thanks @bbodenmiller) +- Link to PSScriptAnalyzer rule documentation from the README (#1642) (thanks @bbodenmiller) - Add HelpInfoUri to module manifest (#1651) (by @sdwheeler) - Add documentation around CustomRulePath in Settings file to README.md (#1636) (thanks @johlju) - Use allowlist and blocklist terminology, supply alternate configuration key for PSAvoidUsingCmdletAliases (#1604) (by @bergmeister) From 1117c9f8bf20835bd8a33ea90be428e831ecb0a1 Mon Sep 17 00:00:00 2001 From: "James Truher [MSFT]" Date: Mon, 23 Aug 2021 10:44:53 -0700 Subject: [PATCH 15/16] Update CHANGELOG.MD Co-authored-by: Robert Holt --- CHANGELOG.MD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.MD b/CHANGELOG.MD index 86c6b6085..7bb309238 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -7,7 +7,7 @@ - Replace unhelpful warning around `process` aliasing `Get-Process` with warning about misused syntax (#1638) (by @bergmeister) - Fix `FunctionInfo` fallback AST attribute analysis for UseShouldProcessCorrectly (#1659) (thanks @hubuk) - Do not increase indentation after a left parenthesis if the previous token is a newline and the next token is not a newline (#1469) (by @bergmeister) -- UseConsistenWhitespace - CheckOpenBrace setting: Do not warn when being preceded by open parenthesis (#1633) (by @bergmeister) +- UseConsistentWhitespace - CheckOpenBrace setting: Do not warn when being preceded by open parenthesis (#1633) (by @bergmeister) ### New Rule From b13e6811aff5dad322d2d4c42aac32e645fcde01 Mon Sep 17 00:00:00 2001 From: "James Truher [MSFT]" Date: Mon, 23 Aug 2021 10:45:00 -0700 Subject: [PATCH 16/16] Update CHANGELOG.MD Co-authored-by: Robert Holt --- CHANGELOG.MD | 1 - 1 file changed, 1 deletion(-) diff --git a/CHANGELOG.MD b/CHANGELOG.MD index 7bb309238..bbe2e241b 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -12,7 +12,6 @@ ### New Rule - Make UseSingularNouns rule work in PowerShell 7 (#1627) (by @bergmeister) - - UseConsistentWhitespace: Create option to ignore assignment operator inside hashtable (#1566) (thanks @daviesj) ### Miscellaneous