-
Notifications
You must be signed in to change notification settings - Fork 382
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merge changes of 1.17.1 (including 1.17.0) into Master #1018
Merged
Conversation
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
Prior to the fix, any text editing action that tried to append text at the end of a line, would throw.
Fix formatter crash
… SuggestedCorrectionExtent information as a correction. It uses UTF8 to read/write the file for avoiding problems with special characters such as the copyright symbol in psd1 files but this probably needs to be enhanced to preserver the encoding of the original file. This is a a minimum (and hopefully) viable implementation of issue 802. It works for most files of the PowerShell repo but throws a 'EditableTextInvalidLineEnding' error for one file (this seems to be an issue with existing code that fixes EditableText)
Prepare release v1.16.1
… in the case of UTF8, a BOM will get added. Update help markdown to fix help related tests.
…rMarks overload. Using StreamReader.Peek() instead of StreamReader.ReadToEnd() is sufficient to detect the encoding. This improves the overall behaviour but when run against the PowerShell repo, it will still convert the ASCI psd1 files into UTF8 files. I think this is due to the implementation of the EditableText class.
… into AutoFixWarnings
…nalyzer into AutoFixWarnings
Add PSAvoidTrailingWhitespace rule
…o a per process path and per file basis. Propagating it further down would not make sense because then it would need to analyze all files, in this case SupportShouldContinue could be implemented in the future.
…witch and the new SupportsShouldProcess Func
…ables (#958) * Make UseDeclaredVarsMoreThanAssignments not flag anything for drive qualified variables * fix test syntax
…-alpha13 to official version 6.0.2 from powershell-core feed, which requires upgrade to netstandard2.0 (#919) * Upgrade system.automation.management to 6.0.1.1 for netstandard, which required upgrade from netstandard 1.6 to netstandard2.0,which included some breaking changes in netstandard2.0 that required some more nuget packges. * use release version of TypeExtensions instead of pre-release * Update System.Management.Automation from 6.0.1.1 to 6.0.2 * run PowerShell Core tests only if image has at least 6.0.2 as required by the new system.management.automation package. * install pwsh for windows if required instead of skipping tests. Thanks for Ilya for the help to get that working * upgrade to net 461 and use in full clr as well * fix other references to net451 with net461 * Revert "fix other references to net451 with net461" This reverts commit d31a55b. * Revert "upgrade to net 461 and use in full clr as well" This reverts commit 52d8521. * use v3/5 reference assemblies * Make UseIdenticalMandatoryParametersDSC rule compilable for v4 by introducing PSV4Release Remove old csproj files that are not needed any more * fix wmf4 build * Use 1.0.0-alpha* of Microsoft.Management.Infrastructure nuget package (i.e. latest instead of specific)
Remove extraneous import-module commands in tests
* move test code of appveyor build into its own function to expose test differences * remove setting erroraction in appveyor module to have the same behaviour as in yaml * fix tests due to scoping bug in PowerShell * fix test due to powershell bug wherby $error is not defined in the local scope when being executed inside a module * another similar test fix (same as before) and restore erroractionpreference in module again
…nd improve new PossibleIncorrectUsageOfAssignmentOperator rule (#881) * first working prototype that warns against usage of the redirection operator inside if statements. TODO: rename rule, adapt documentation and error message strings * adapt error message strings and add tests * remove old todo comment * remove duplicated test case * syntax fix from last cleanup commits * tweak extents in error message: for equal sign warnings, it will point to the equal sign (instead of the RHS only) and fore file redirections it will be the redirection ast (e.g. '> $b') * Enhance check for assignment by rather checking if assigned variable is used in assignment block to avoid false positives for assignments: check if variable on LHS is used in statement block update documentation and change level to warning since we are now much more certain that a violation. is happening Commits: * prototype of detecting variable usage on LHS to avoid false positives * simplify and reduce nesting * fix regression by continue statements * fix last regression * add simple test case for new improvemeent * finish it off and adapt tests * update docs * minor style update * fix typo * fix test due to warning level change * tweak messages and readme * update to pester v4 syntax * Revert to not check assigned variable usage of RHS but add optional clang suppression, split rule and enhance assignment operator rule to not warn for more special cases on the RHS * Minor fix resource variable naming * uncommented accidental comment out of ipmo pssa in tests * do not exclude BinaryExpressionAst on RHS because this case is the chance that it is by design is much smaller, therefore rather having some false positives is preferred * update test to test against clang suppression * make clang suppression work again * reword warning text to use 'equality operator' instead of 'equals operator' * Always warn when LHS is $null * Enhance PossibleIncorrectUsageOfAssignmentOperator rule to do the same analysis for while and do-while statements as well, which is the exact same use case as if statements * tweak message to be more generic in terms of the conditional statement * Address PR comments
* remove old cmdlet help file that is not needed any more due to help being markdown based. * Remove about_scriptanalyzer copy step from build and links to it in markdown. Also correct version of platyps
…hell 6.0 (#917) * Add warnings about readonly variables introduced in PowerShell 6.0 * use custom message for variables that only apply to ps 6.0 * Remove redundant quotes in IT block because Pester adds them now automatically * Make it throw an Error when PSSA is executed on PSCore * address pr comments * exclude PSUseDeclaredVarsMoreThanAssignments rule for tests
* Add base changelog for 1.17.0 * update PR number of this PR, I guessed wrong ;) * tweak CHANGELOG.MD and simplify readme * update release date, which will be delayed by at least 2 weeks to not give people who watch the PR wrong hopes
…ngs file (#968) * improve documentation * Remove extraneous space character * Address remaining PR comments about improvements of the wording
* add working docker images with examples * Fix docker scripts (--it should have been -it and Windows/Linux command were the wrong way around)
…hed in the gallery (#983) * First set of files for vsts build * Added scripts for VSTS build Updated docker file and releasemaker module * Change vsts build script to be able to put built module anywhere based on _DockerVolume_ Remove a comment * Revert "Change vsts build script to be able to put built module anywhere based on _DockerVolume_" This reverts commit 82ebc03.
* Fix table of contents * fix ToC reference due to merge
#990) * Add microsoft/powershell:NanoServer example and simplify all docker examples to use the microsoft/powershell image tags * summarise and unify
* Trim out TypeNotFoundParseErrors. * Add verbose logging and test * fix test syntax * add test for -path parameter set * use pester test drive * fix tests to not run in library usage session * Address PR comments about additional assertion and xml comment * Remove unused dotnet-core NuGet feed that caused build failure due to downtime * Fix typo and move string into resources * fix compilation error (forgot to check-in file) * fix typo to also build for psv3 * Since the using statement was introduced only inn v5, move to block that runs only on v5+ * fix tests by moving the tests (clearly a smell that something is wrong in this test script * write warning on parse errors instead of verbose output and tweak message * instead of returning a warning, return a diagnostic record with a custom rule name and tweak error message * poke build due to sporadic AppVeyor failure on setup (not a test) -> rename variable
…pport questions (#986) * add more details * Use multiple issue templates for bugs, features requests and support questions.
…used via Get-Variable (#925) * Do not trigger UseDeclaredVarsMoreThanAssignment when using Get-Variable * update licence text * address PR comments
…ecification: Mandatory=value and value!=0 (#969) * AvoidDefaultValueForMandatoryParameter triggers when the field has specification: Mandatory=value and value!=0 * Add tests for AvoidDefaultValueForMandatoryParameter rule. * Code cleanup for AvoidDefaultValueForMandatoryParameter rule fix.
* Added Chocolatey Install help * Fixed typo * Added clarification on community package support
…, default to the current location for the directory search of the implicit settings file (#979) * 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 * add test case * fix test so that it would actually fail if the bug got re-introduced
…S and WMF3/4 that are used by UseCompatibleCmdlets rule (#954) * add typedate for pwsh 6.0.2 on Windows 10.0.16299.251 and for Linux from Ubuntu 16 (LTS) * update docs and remove old alpha versions for windows/linux * add v3 command data file from Tyler. And add v5.1 to docs as well * add wmf4 command data file produced on new vanilla winserver2012r2 azure machine * add mac command data file from James and correct it from osx to macOs
…based rules (#1000) * Populate SuggestedCorrections when using scriptule and make it public for easier construction in PowerShell * add documentation and test * use [Type]::new() constructor instead of new-object * Revert "use [Type]::new() constructor instead of new-object" Reason: this was only introduced in PowerShell v5 and therefore fails the PS v4 build and we should not give examples that do not work on any supported version This reverts commit aa90ea3.
* Fix table to refer to existing md files, add col for Configurable * Remove deprecated rules, rename to match actual rule sans PS prefix * Add Pester tests for rule doc files, add back UseSingularNouns.md file * Add Pester tests for verifying rule doc README.md file * fix typo in documentation folder, remove redundant ipmo call new tests in CI and add to docs * Add rules that will be present in 1.17 and fix typo in md file name * remove redundant import of PSScriptAnalyzerTestHelper test helper module in documentation test * Fix doc tests for PS v4 and PS Core This commit removes rules that aren't available on these versions * Remove leftovers from deprecated rules AvoidUsingFilePath, AvoidUninitializedVariable and AvoidTrapStatement in code and documentation. Fix markdown in PowerShellBestPractices.md and tidy up * added remarks about rules not being available in certain powershell versions * Add superscript/footnote on rules not available everywhere * Update test to strip off the optional superscript markdown
… when assigning a .Net property and only look at the LHS (#1008) * Fix NullReferenceException in AvoidAssignmentToAutomaticVariable rule when assigning a net property to a .Net property * when variableExpressionAst is null, then continue loop to reduce nesting * fix indentation for cleaner diff * Fix issue #1013 as well by making sure the rule looks only the LHS * Fix issue #1012 as well * Simplify test that checks that PSSA does not throw to address PR review
* Add PSv4 assemblies to the signing jobs * Remaining release notes and version update to 1.17.0 (#1002) * 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 * bump version in csproj and fix date in release log * add choco pr and fix table of contents in readme * add new commits * add recent commit * Update PR number
…on number in csproj files (#1017)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Following the recommended flow in the ReadMe, at release time, the development branch should be merged into master (fast-forward merge)