Skip to content

checkstyle-tester: Yaml format for project list  #866

@romani

Description

@romani

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: #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:

  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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions