checkstyle / checkstyle/contribution

checkstyle-tester: Yaml format for project list

Open
#866 20 comments 0 reactions 0 assignees View on GitHub
blocked
Dominant language
Java
Stars
57
Forks
168
Avg merge
1d 11h
Merged PRs (30d)
15

Description

We have now very weird format of project list.
https://github.com/checkstyle/contribution/blob/master/checkstyle-tester/projects-to-test-on.properties
It was quick and old decision. It was format for bash language, we deprecated this version a long time ago.
Let's do yaml format for it.
All long lists, should become elements of array in yaml.

Conceptually, we can use any other type that will allow us to make single line in existing format to be multiple lines that easily to manage.

Look at jdk lines to feel a pain of existing format.

[existing](https://github.com/checkstyle/contribution/blob/master/checkstyle-tester/projects-to-test-on.properties#L7C1-L8C1): `#checkstyle|git|https://github.com/checkstyle/checkstyle.git|master|**/.ci-temp/**/*,**/resources-noncompilable/**/asttreestringprinter/**/*,**/resources-noncompilable/**/filefilters/**/*,**/resources-noncompilable/**/main/**/*,**/resources-noncompilable/**/suppressionsstringprinter/**/*,**/resources-noncompilable/**/gui/**/*,**/resources-noncompilable/**/javadocpropertiesgenerator/**/*,src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/javaparser/InputJavaParser.java,**/InputAllEscapedUnicodeCharacters.java,**/resources-noncompilable/**/javaparser/InputJavaParser.java,**/resources-noncompilable/**/checks/imports/unusedimports/InputUnusedImportsSingleWordPackage.java,**/resources-noncompilable/**/grammar/java19/*,**/resources-noncompilable/**/treewalker/**/*
`

proposed:
```
projects:
- sevntu-checkstyle:
- scm: git
- url: https://github.com/sevntu-checkstyle/sevntu.checkstyle
- reference: master
- spotbugs:
- scm: git
- url: https://github.com/spotbugs/spotbugs
- reference: 3.1.2
# Those projects are quite old and have lot of legacy code
- apache-jsecurity:
- scm: git
- url: https://github.com/apache/jsecurity
- reference: c2ac5b90a467aedb04b52ae50a99e83207d847b3
- apache-struts
- scm: git
- url: https://github.com/apache/struts.git
- branch: master
- excludes:
- **/apache-struts/**/resources/**/*
- checkstyle:
- scm: git
- url: https://github.com/checkstyle/checkstyle.git
- reference: master
- excludes:
- **/.ci-temp/**/*
- **/resources-noncompilable/**/asttreestringprinter/**/*
- **/resources-noncompilable/**/filefilters/**/*
- **/resources-noncompilable/**/main/**/*
- **/resources-noncompilable/**/suppressionsstringprinter/**/*
- **/resources-noncompilable/**/gui/**/*
- **/resources-noncompilable/**/javadocpropertiesgenerator/**/*
- src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/javaparser/InputJavaParser.java
# 'InputAllEscapedUnicodeCharacters' must be skipped because it is too big and slows down JXR
- **/InputAllEscapedUnicodeCharacters.java
- **/resources-noncompilable/**/javaparser/InputJavaParser.java
- **/resources-noncompilable/**/checks/imports/unusedimports/InputUnusedImportsSingleWordPackage.java
- **/resources-noncompilable/**/grammar/java19/*
- **/resources-noncompilable/**/treewalker/**/*
```

main reason of updaate is exclusion list, that is long, especially i jdk.

[usage now](https://github.com/checkstyle/checkstyle/blob/master/.ci/validation.sh#L849C1-L854C74):
```
sed -i'' 's/^guava/#guava/' projects-to-test-on.properties
sed -i'' 's/#apache-struts/apache-struts/' projects-to-test-on.properties
groovy ./diff.groovy --listOfProjects projects-to-test-on.properties \
--patchConfig checks-nonjavadoc-error.xml -p "$BRANCH" -r ../../.. \
--useShallowClone \
--allowExcludes --mode single -xm "-Dcheckstyle.failsOnError=false"
```

will be:
```
groovy ./diff.groovy --listOfProjects projects-to-test-on.yml -projects=apache-struts,guava \
--patchConfig checks-nonjavadoc-error.xml -p "$BRANCH" -r ../../.. \
--useShallowClone \
--allowExcludes --mode single -xm "-Dcheckstyle.failsOnError=false"
```

we do not need Enable/Disable of projects, we just need list projects as parameter something like `-projects=apache-struts,guava`. No `-projects` will mean use all.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.