-
-
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
Format google IT tests' input files to follow all the rules of google java style guide #15218
Comments
…added its usage in section 2.1 File Name
After reading this issue description multiple times, I still cannot understand why we are doing this, how this is in scope for GSOC, and why we did not get maintainer consensus on the issue before approval. |
formatter come to radar as it is detected in diff of style and mentioned in style guide: we have several issues where users complains on checkstyle that it is not aligned with google-java-format. Java Style pages are updated by same Googler as maintainer of google-java-format. ITs Inputs are example of Good(fully compliant code) and code with Violations (not compliant by formatting or non-formatting issues). If we find any conflict between formatter and Checkstyle we will reference to style guide wording to find out who has defect. All pointing to fact that we have to be friends with formatter, and we make a good test foundation that are aligned with this tool for formatting issues of style guide. google-java-format is versioned, so we need to use it make sure that during update of google-java-format dependency, it will might update Input sources but it will continue to be non conflicting with checkstyle. The only way to archive it is to do it on each commit. |
In future, we will move formatting of inputs to special CI job to do this (kind of requirements before jdk17) , outside of mvn install execution, but it is more complicated process, let's not go this direction now. |
…ecial Escape Sequences to follow google java style guide rules
…me to follow google style guide rules
…pe Sequences to follow google java style guide rules
Ok, I forgot to mention that in 2 days also mean "future" , here it is, CI job: |
…rs to follow google style guide rules
…e: defined to follow google style guide rules
…ceptions: not ignored to follow goolge style guide rules
…ceptions: not ignored to follow google style guide rules
…Name to follow google style guide rules
…ace to follow google style guide rules
…s k & R Style to follow google style guide rules
…imit to follow google style guide rules
…l form to follow google style guide rules
…ontal Whitespace to follow google style guide rules
…s to follow google style guide rules
…s to follow google style guide rules
…ontal Whitespace to follow google style guide rules
…ontal Whitespace to follow google style guide rules
… whole config testing
…s to follow google style guide rules
…s to follow google style guide rules
…ontal Whitespace to follow google style guide rules
…ontal Whitespace to follow google style guide rules
…espace to follow google style guide rules
…y be concise to follow google style guide rules
all sections have been formatted, closing the issue |
All google tests are being migrated to whole config testing in this issue: #15214
We detected that Google java style simply reference to google-java-format as source of truth for specific chapter about line length (not whole) https://github.com/checkstyle/checkstyle/pull/14901/files#r1639771738 , same is location of
{
at https://github.com/checkstyle/checkstyle/pull/14901/files#r1621156853 . So we need to use this tool for Inputs and see cases where we are conflicting to make decision who is right. For other chapters we will still look at style guide first as source of truth.As part of this issue, all the google tests' input files needs to be formatted to follow google java style guide rules. The input files should be formatted by google-java-format tool locally. This tool helps us to format the java file to follow google java style guide rules. Though this tool formats only some specific parts of the input file, it can fix incorrect spacing, indentation, brackets/curly braces placements, etc but it cannot fix incorrect variable names, missing javadoc comments, etc.
The input files will require to follow all the rules of the style guide, expect it will contain violations only corresponding to their section. In some cases, the input file will require some extra violations outside its corresponding section, which will be required to test the section properly, example: #15220 (comment)
Initially, we thought of adding google-java-format tool as a dependency to our project ( PR in which we tried to did this ) but after doing discussion on this topic, maintainers have come upon the idea of not adding this tool as a dependency for now. In future, we might add support for this tool, but for now we're not doing this, this tool should be used locally to format the input file but should not be added to CS as a dependency.
Input files of following sections needs to be formatted to follow all rules of google java style guide:
The text was updated successfully, but these errors were encountered: