-
Notifications
You must be signed in to change notification settings - Fork 5
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
Issue #74: Create unit tests for line strategy for Checker checks (non-TreeWalker) #84
Conversation
6e4d366
to
3906ebf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
items (please apply comments to all files):
@@ -0,0 +1,31 @@ | |||
diff --git a/src/main/java/Checker/FileLength/Test.java b/src/main/java/Checker/FileLength/Test.java |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please fix path to files, it might not be critical in this particular case, but will be good practice ones we come to multifile and different folders diffs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
diff --git a/src/main/java/Checker/FileLength/Test.java b/src/main/java/Checker/FileLength/Test.java | ||
index f8603ef..d10d86a 100644 | ||
--- a/Test/Test.java | ||
+++ b/Test/Test.java |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please fix path here too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
…checks (non-TreeWalker)
Merged in scope of #86 |
public class Test { | ||
// Long line ---------------------------------------------------------------- | ||
// Contains a tab -> <- //warn | ||
// Contains trailing whitespace -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like you don't need trailing spaces in this input file. FileTabCharacter doesn't check them
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -0,0 +1,14 @@ | |||
package Checker.FileLength; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add comments to all input files where you expect a violation. It's hard to always compare with expected.txt and patch.diff.
Something like: // violation newline/patchedline
or // violation newline
(depends on violation and strategy)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -0,0 +1,4 @@ | |||
Starting audit... | |||
[ERROR] /Users/hgh/Downloads/my_file/IDEA_workspace/patchfiltergeneratepatch/src/main/java/Checker/RegexpMultiline/Test.java:18: Line matches the illegal pattern 'System\.out\.\n print\('. [RegexpMultiline] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this line is not expected as I understand, because patch changes line 19, and this violation is for number 18. This should be covered by context strategy. Am I correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@baratali yes, you are correct, and I have add notes in UT about RegexpMultiline that this situation will be solved in context strategy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@HuGanghui , please remove this line if it's not expected in patchedline strategy.
Issue #74: Create unit tests for line strategy for Checker checks (non-TreeWalker)