-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Fix existing cases of getFileContents()
usage
#11166
Comments
@romani I have some custom checks for JavaDocs and, I'm afraid, it's not quite clear what exactly is supposed to be used instead of My goal is it check that JavaDoc is presented on every element that matches specific condition, has some tag ( |
@remal instead of |
@remal , please look at checkstyle/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/AtclauseOrderCheck.java Line 152 in 0b3a260
With such inheritance, you will get whole ast of javadoc content. |
Another approach is to override
Such approach does not have any performance problems. |
I am on JavadocStyleCheck |
@aayushRedHat , please be aware that refactoring of javadoc check needs changing extension of abstract class to get AST of javadoc. It might be bigger update than for non javadoc Checks. Do not hesitate to set draft PR to share with us your direction and double check that you care right path. |
I am on ImportControlCheck |
@Kevin222004 , please do not deal with Javadoc* Checks, it will require big redesign we do not have plan for this, please deal with regular Checks for now. |
@romani I want to work on this. I can take EmptyLineSeparatorCheck. Is there anything I should keep in mind before starting? and |
@mahfouz72, please help us to refactor this Check, yes, few PRs are good to ease review. |
after #9889
We need to fix all existing cases of
getFileContents()
usage by usage on AST based logic.checkstyle/src/main/java/com/puppycrawl/tools/checkstyle/api/AbstractCheck.java
Lines 195 to 206 in 1346ff9
The same is true for methods
getLine
andgetLines
that do allow to have access to not AST content.cases:
RegexpCheck.java (not applicable as it is operates on text file, not java files, by design)RegexpSinglelineJavaCheck.java (this is by design match to raw string, same a RegexpCheck)it is better to resolve each case in separate PR. Each PR should remove the suppression to show the issue is fixed. haanhvu@1439170#diff-c1ffc75b7152435a4d5d40d7ee9b32b57402959b1ad471a41e753ea67554378b
For javadoc please consult with maintainers before starting
Javadoc modules that will require extra effort as redesign is required: - [ ] JavadocMethodCheck.java (1) - [ ] JavadocStyleCheck.java - [ ] JavadocTypeCheck.java - [ ] JavadocVariableCheck.java - [ ] MissingJavadocMethodCheck.java - [ ] MissingJavadocTypeCheck.java - [ ] WriteTagCheck.javaThe text was updated successfully, but these errors were encountered: