-
-
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
Create and Document Check Update Procedure for New Language Features #14889
Comments
@rnveach @mahfouz72 please share any additional check discovery methods that you can think of. |
These are all great methods, and I believe they should be sufficient to show us where updates should be made.
I think finding real usage examples in large codebases will be helpful. This may guide us in identifying potential violations and areas that require to be covered by checks |
One of the first steps is to find the JEPS and JLS for the new token. Ensure document has number/letter points to be referenced later. Some linking to them would also be good. Some checks will always be impacted. IllegalToken.
Methods and constructors as an example.
Left and right curly.
Reviewing to find pertinent information to the current JEP |
another good method is to review similar static code analysis tools and IDE inspection rules for new features it may help us to identify potential check updates. |
…r New Language Features
…r New Language Features
@rnveach please add "approved" label if you are good |
…r New Language Features
…r New Language Features
…r New Language Features
…r New Language Features
…r New Language Features
…r New Language Features
…r New Language Features
…r New Language Features
…r New Language Features Co-authored-by: Nick Mancuso <31252532 [email protected]>
…r New Language Features
…r New Language Features
…r New Language Features
…r New Language Features
…r New Language Features
…r New Language Features
…r New Language Features
…r New Language Features
…r New Language Features
…r New Language Features
…r New Language Features
…r New Language Features
…r New Language Features
…r New Language Features
…r New Language Features
When we add support for new language features, we always play a guessing game of what checks should be updated. While some heuristics will always be required, we can also have a procedure to follow to at least give is some direction and confidence that we have done our due diligence to fully support new language features. Adding the ability to parse new language features is really only the beginning of what we need to do.
As we have seen in the past, it is good to follow the bug report template to aid in demonstration of need for check updates.
We can call this document "New Language Feature Check Integration Process".
We need to create a document with the following outline:
Some sources of inspiration that I have used in the past for check discovery:
Consider similar tokens, i.e. for
RECORD_DEF
, it was reasonable to look at all checks that hadCLASS_DEF
in their acceptable tokens.Similar constructs. An example of this would be constructors and methods.
JEPS themselves; they often have some recommendations about how to use new language features. Often times, JEPs may solve a particular problem in the language, and we can create checks to suggest to use these new features instead of the "old syntax". An example would be
instanceof
, where we avoid the cast by pattern matching.Whitespace checks touch on most tokens
Examples in large codebases. To help facilitate this, we need to find some projects that use newer language features. Let's look through the new projects files in contribution that @Kevin222004 added last year. Example: https://github.com/checkstyle/contribution/blob/master/checkstyle-tester/github-action-projects1.properties
Review other static analysis tools (PMD, IDEA Inspections, spotbugs, etc.)
This document will live in the
docs
directory.The text was updated successfully, but these errors were encountered: