Skip to content

update google-java-format.sh to validate that all Input that are excluded have file InputFormatted #17258

@romani

Description

@romani

code

echo "Formatting all Input files file at src/it/resources/com/google/checkstyle/test :"
INPUT_PATHS=($(find src/it/resources/com/google/checkstyle/test/ -name "Input*.java" \
| sed "s|src/it/resources/com/google/checkstyle/test/||" \
| grep -v "rule231filetab/InputWhitespaceCharacters.java" \
| grep -v "rule3sourcefile/InputSourceFileStructure.java" \
| grep -v "rule332nolinewrap/InputNoLineWrapping.java" \

this script should be updated to validate that all Input that are excluded have file InputFormatted
for example rule231filetab/InputWhitespaceCharacters.java should have
rule231filetab/InputFormattedWhitespaceCharacters.java
and it should be almost same in size, with allowance to be different in size for ~20 bytes (results of formatting).

Violation comment might be required to be removed by sed, to avoid bigger diff in size.

Example:
https://www.diffchecker.com/2Y146tNY/

Image

Image

Image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions