Skip to content
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

Warn when using FileRedirection operator inside if/while statements and improve new PossibleIncorrectUsageOfAssignmentOperator rule #881

Merged
Merged
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
4a0485c
first working prototype that warns against usage of the redirection o…
bergmeister Feb 8, 2018
2c0bc28
adapt error message strings and add tests
bergmeister Feb 8, 2018
29c7e34
remove old todo comment
bergmeister Feb 8, 2018
7310387
remove duplicated test case
bergmeister Feb 8, 2018
4078e41
syntax fix from last cleanup commits
bergmeister Feb 8, 2018
b7ad069
tweak extents in error message: for equal sign warnings, it will poin…
bergmeister Feb 12, 2018
8a48a62
Enhance check for assignment by rather checking if assigned variable …
bergmeister Feb 17, 2018
c9d510f
Merge branch 'development' of https://github.com/PowerShell/PSScriptA…
bergmeister Feb 20, 2018
fd339f6
tweak messages and readme
bergmeister Feb 20, 2018
5e8a8be
Merge branch 'WarnPipelineInsideIfStatement' of https://github.com/be…
bergmeister Feb 20, 2018
c74a746
Merge branch 'development' of https://github.com/PowerShell/PSScriptA…
bergmeister Feb 20, 2018
b467d10
update to pester v4 syntax
bergmeister Feb 20, 2018
594414f
Revert to not check assigned variable usage of RHS but add optional c…
bergmeister Feb 25, 2018
c4e242e
Minor fix resource variable naming
bergmeister Feb 25, 2018
f7ce114
uncommented accidental comment out of ipmo pssa in tests
bergmeister Feb 25, 2018
bc00213
do not exclude BinaryExpressionAst on RHS because this case is the ch…
bergmeister Feb 26, 2018
c6c4f4a
update test to test against clang suppression
bergmeister Feb 26, 2018
691f2ce
make clang suppression work again
bergmeister Feb 26, 2018
fe30f4d
reword warning text to use 'equality operator' instead of 'equals ope…
bergmeister Feb 27, 2018
78ef4bf
Always warn when LHS is $null
bergmeister Feb 28, 2018
675e3eb
Enhance PossibleIncorrectUsageOfAssignmentOperator rule to do the sam…
bergmeister Mar 15, 2018
ad008cd
tweak message to be more generic in terms of the conditional statement
bergmeister Mar 15, 2018
d042f37
Merge branch 'development' of https://github.com/PowerShell/PSScriptA…
bergmeister Mar 23, 2018
f530d75
Address PR comments
bergmeister Mar 23, 2018
ed95d84
Merge branch 'development' of https://github.com/PowerShell/PSScriptA…
bergmeister Mar 30, 2018
bdf39ac
Merge branch 'development' of https://github.com/PowerShell/PSScriptA…
bergmeister Apr 5, 2018
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
remove old todo comment
  • Loading branch information
bergmeister committed Feb 8, 2018
commit 29c7e3460c5b375c8c03f8b87a6f6b462980e7a4
2 changes: 1 addition & 1 deletion Rules/PossibleIncorrectUsageOfAssignmentOperator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public IEnumerable<DiagnosticRecord> AnalyzeScript(Ast ast, string fileName)
if (fileRedirectionAst != null)
{
yield return new DiagnosticRecord(
Strings.PossibleIncorrectUsageOfComparisonOperatorFileRedirectionOperatorError, fileRedirectionAst.Extent, // TODO: better error message string and rename rule
Strings.PossibleIncorrectUsageOfComparisonOperatorFileRedirectionOperatorError, fileRedirectionAst.Extent
GetName(), DiagnosticSeverity.Warning, fileName);
}
}
Expand Down