Skip to content

Add Fix switch parameter for 'File' parameter set to auto-correct warnings (#802) #817

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

Merged
merged 32 commits into from
Nov 30, 2017
Merged
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
77ff614
Add AutoFix switch parameter for 'File' parameter set, which uses the…
bergmeister Aug 30, 2017
ef75719
PR 817: Name switch 'Fix' and preserver Encoding of the file. However…
bergmeister Sep 12, 2017
24732ee
PR 817 Minor syntax fix for markdown file
bergmeister Sep 12, 2017
4dc4aeb
Improve encoding handling by not using the detectEncodingFromByteOrde…
bergmeister Sep 30, 2017
792fe30
improve wording of help as suggested in PR
bergmeister Nov 6, 2017
5a2f47b
Add simple test for -Fix switch
bergmeister Nov 6, 2017
023f9e3
improve test by restoring original file and also asserting against th…
bergmeister Nov 6, 2017
5d0b52d
Merge branch 'master' of https://github.com/PowerShell/PSScriptAnalyz…
bergmeister Nov 6, 2017
78d9663
Merge branch 'development' of https://github.com/PowerShell/PSScriptA…
bergmeister Nov 6, 2017
6edeef4
Clean up test
bergmeister Nov 6, 2017
f129846
Refactor 'fix' switch out of AnalyzePath method as requested in PR
bergmeister Nov 8, 2017
bfa1c54
Implement SupportShouldProcess for InvokeScriptAnalyzerCommand down t…
bergmeister Nov 8, 2017
50af5d2
Adapt the full .net wrapper in LibraryUsage.tests.ps1 with the -fix s…
bergmeister Nov 8, 2017
771ffb6
Fix Func wrapper in LibraryUsage.tests.ps1
bergmeister Nov 8, 2017
701c264
Another fix to LibraryUsage.tests.ps1 to accomodate -Fix switch and a…
bergmeister Nov 8, 2017
a16c232
Always return true for shouldprocess
bergmeister Nov 9, 2017
e64335f
Add supportshouldprocess to full .net wrapper library
bergmeister Nov 9, 2017
4297ff4
Add 'WhatIf' to common words for help tests
bergmeister Nov 9, 2017
9785993
Add 'Confirm' to common words for help tests
bergmeister Nov 9, 2017
14197ce
Add debug line to debug failing test
bergmeister Nov 9, 2017
fffcd76
Add more debug info for test failure
bergmeister Nov 9, 2017
c707a1e
Add comment about deliberate whitespace warning
bergmeister Nov 9, 2017
9d4e8ef
Number of expected warnings now 5 in -fix test due to PSAvoidTrailin…
bergmeister Nov 9, 2017
c0f881d
Update expected test file
bergmeister Nov 9, 2017
c59b6b0
Remove trailing whitespace in expected file since this gets fixed now
bergmeister Nov 9, 2017
6f6896a
Remove debugging line since test passes now
bergmeister Nov 9, 2017
f5ac9eb
Set-Content -NoNewline was only introduced in PS v5 and would therefo…
bergmeister Nov 9, 2017
8e46750
Syntax fix of last commit
bergmeister Nov 9, 2017
e184e3b
Another small syntax fix (sorry, I am commiting from my mobile)
bergmeister Nov 9, 2017
0df445b
Return $pscmdlet.shouldprocess in .net test wrapper
bergmeister Nov 9, 2017
8525e03
Optimize -Fix switch to only write the fixed file to disk if any fixe…
bergmeister Nov 13, 2017
e12c4a6
Merge branch 'AutoFixWarnings' of https://github.com/bergmeister/PSSc…
bergmeister Nov 13, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add more debug info for test failure
  • Loading branch information
bergmeister authored Nov 9, 2017
commit fffcd7615fb3ec22a32413055be50c967a47b706
2 changes: 1 addition & 1 deletion Tests/Engine/InvokeScriptAnalyzer.tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ Describe "Test -Fix Switch" {
It "Fixes warnings" {
# we expect the script to contain warnings
$warningsBeforeFix = Invoke-ScriptAnalyzer $directory\TestScriptWithFixableWarnings.ps1
$warningsBeforeFix | % { Write-Verbose $_ -Verbose }
$warningsBeforeFix | % { Write-Verbose "$($_.Message)" -Verbose }
$warningsBeforeFix.Count | Should Be 4

# fix the warnings and expect that it should not return the fixed warnings
Expand Down