<commit_before>#!/bin/bash
set -e

source ./.ci/util.sh

case $1 in

guava-with-google-checks)
  CS_POM_VERSION="$(getCheckstylePomVersion)"
  BRANCH=$(git rev-parse --abbrev-ref HEAD)
  echo CS_version: $CS_POM_VERSION
  checkout_from https://github.com/checkstyle/contribution
  cd .ci-temp/contribution/checkstyle-tester
  sed -i.'' 's/^guava/#guava/' projects-to-test-on.properties
  sed -i.'' 's/#guava|/guava|/' projects-to-test-on.properties
  cd ../../../
  mvn -e --no-transfer-progress clean install -Pno-validations
  cp src/main/resources/google_checks.xml .ci-temp/google_checks.xml
  sed -i.'' 's/warning/ignore/' .ci-temp/google_checks.xml
  cd .ci-temp/contribution/checkstyle-tester
  export MAVEN_OPTS="-Xmx2048m"
  groovy ./diff.groovy --listOfProjects projects-to-test-on.properties \
      --patchConfig ../../google_checks.xml \
      --mode single --allowExcludes -xm "-Dcheckstyle.failsOnError=false \
      -Dcheckstyle.version=${CS_POM_VERSION}" -p "$BRANCH" -r ../../..
  cd ../..
  removeFolderWithProtectedFiles contribution
  rm google_checks.*
  ;;

guava-with-sun-checks)
  CS_POM_VERSION="$(getCheckstylePomVersion)"
  BRANCH=$(git rev-parse --abbrev-ref HEAD)
  echo CS_version: $CS_POM_VERSION
  checkout_from https://github.com/checkstyle/contribution
  cd .ci-temp/contribution/checkstyle-tester
  sed -i.'' 's/^guava/#guava/' projects-to-test-on.properties
  sed -i.'' 's/#guava|/guava|/' projects-to-test-on.properties
  cd ../../../
  mvn -e --no-transfer-progress clean install -Pno-validations
  cp src/main/resources/sun_checks.xml .ci-temp/sun_checks.xml
  sed -i.'' 's/value=\"error\"/value=\"ignore\"/' .ci-temp/sun_checks.xml
  cd .ci-temp/contribution/checkstyle-tester
  export MAVEN_OPTS="-Xmx2048m"
  groovy ./diff.groovy --listOfProjects projects-to-test-on.properties \
      --patchConfig ../../sun_checks.xml \
      --mode single --allowExcludes -xm "-Dcheckstyle.failsOnError=false \
      -Dcheckstyle.version=${CS_POM_VERSION}"  -p "$BRANCH" -r ../../..
  cd ../..
  removeFolderWithProtectedFiles contribution
  rm sun_checks.*
  ;;

openjdk14-with-checks-nonjavadoc-error)
  LOCAL_GIT_REPO=$(pwd)
  BRANCH=$(git rev-parse --abbrev-ref HEAD)
  checkout_from https://github.com/checkstyle/contribution
  sed -i.'' 's/value=\"error\"/value=\"ignore\"/' \
        .ci-temp/contribution/checkstyle-tester/checks-nonjavadoc-error.xml
  cd .ci-temp/contribution/checkstyle-tester
  cp ../../../.ci/openjdk-projects-to-test-on.config openjdk-projects-to-test-on.config
  sed -i '/  <!-- Filters -->/r ../../../.ci/openjdk14-excluded.files' checks-nonjavadoc-error.xml
  export MAVEN_OPTS="-Xmx2048m"
  groovy ./diff.groovy --listOfProjects openjdk-projects-to-test-on.config \
      --mode single --allowExcludes \
      --patchConfig checks-nonjavadoc-error.xml \
      --localGitRepo  "$LOCAL_GIT_REPO" \
      --patchBranch "$BRANCH" -xm "-Dcheckstyle.failsOnError=false"

  cd ../../
  removeFolderWithProtectedFiles contribution
  ;;

no-exception-lucene-and-others)
  CS_POM_VERSION="$(getCheckstylePomVersion)"
  BRANCH=$(git rev-parse --abbrev-ref HEAD)
  echo 'CS_POM_VERSION='${CS_POM_VERSION}
  checkout_from https://github.com/checkstyle/contribution
  cd .ci-temp/contribution/checkstyle-tester
  sed -i'' 's/^guava/#guava/' projects-for-circle.properties
  sed -i'' 's/#infinispan/infinispan/' projects-for-circle.properties
  sed -i'' 's/#protonpack/protonpack/' projects-for-circle.properties
  sed -i'' 's/#jOOL/jOOL/' projects-for-circle.properties
  sed -i'' 's/#lucene-solr/lucene-solr/' projects-for-circle.properties
  export MAVEN_OPTS="-Xmx2048m"
  groovy ./diff.groovy --listOfProjects projects-to-test-on.properties \
      --patchConfig checks-only-javadoc-error.xml \
      --mode single --allowExcludes -xm "-Dcheckstyle.failsOnError=false \
      -Dcheckstyle.version=${CS_POM_VERSION}"  -p "$BRANCH" -r ../../..
  cd ../..
  removeFolderWithProtectedFiles contribution
  ;;

no-exception-cassandra-storm-tapestry)
  CS_POM_VERSION="$(getCheckstylePomVersion)"
  echo 'CS_POM_VERSION='${CS_POM_VERSION}
  BRANCH=$(git rev-parse --abbrev-ref HEAD)
  checkout_from https://github.com/checkstyle/contribution
  cd .ci-temp/contribution/checkstyle-tester
  sed -i'' 's/^guava/#guava/' projects-for-circle.properties
  sed -i'' 's/#tapestry-5/tapestry-5/' projects-for-circle.properties
  sed -i'' 's/#storm/storm/' projects-for-circle.properties
  sed -i'' 's/#cassandra/cassandra/' projects-for-circle.properties
  export MAVEN_OPTS="-Xmx2048m"
  groovy ./diff.groovy --listOfProjects projects-to-test-on.properties \
      --patchConfig checks-only-javadoc-error.xml \
      --mode single --allowExcludes  -xm "-Dcheckstyle.failsOnError=false \
      -Dcheckstyle.version=${CS_POM_VERSION}"  -p "$BRANCH" -r ../../..
  cd ../..
  removeFolderWithProtectedFiles contribution
  ;;

no-exception-hadoop-apache-groovy-scouter)
  CS_POM_VERSION="$(getCheckstylePomVersion)"
  echo 'CS_POM_VERSION='${CS_POM_VERSION}
  BRANCH=$(git rev-parse --abbrev-ref HEAD)
  checkout_from https://github.com/checkstyle/contribution
  cd .ci-temp/contribution/checkstyle-tester
  sed -i'' 's/^guava/#guava/' projects-for-circle.properties
  sed -i'' 's/#apache-commons/apache-commons/' projects-for-circle.properties
  sed -i'' 's/#hadoop/hadoop/' projects-for-circle.properties
  sed -i'' 's/#groovy/groovy/' projects-for-circle.properties
  sed -i'' 's/#scouter/scouter/' projects-for-circle.properties
  export MAVEN_OPTS="-Xmx2048m"
  groovy ./diff.groovy --listOfProjects projects-to-test-on.properties \
      --patchConfig checks-only-javadoc-error.xml \
      --mode single --allowExcludes -xm "-Dcheckstyle.failsOnError=false \
      -Dcheckstyle.version=${CS_POM_VERSION}"  -p "$BRANCH" -r ../../..
  cd ../..
  removeFolderWithProtectedFiles contribution
  ;;

no-exception-only-javadoc)
  CS_POM_VERSION="$(getCheckstylePomVersion)"
  echo 'CS_POM_VERSION='${CS_POM_VERSION}
  BRANCH=$(git rev-parse --abbrev-ref HEAD)
  checkout_from https://github.com/checkstyle/contribution
  cd .ci-temp/contribution/checkstyle-tester
  sed -i.'' 's/^guava/#guava/' projects-to-test-on.properties<commit_msg>infra: fix project file name<commit_after>#!/bin/bash
set -e

source ./.ci/util.sh

case $1 in

guava-with-google-checks)
  CS_POM_VERSION="$(getCheckstylePomVersion)"
  BRANCH=$(git rev-parse --abbrev-ref HEAD)
  echo CS_version: $CS_POM_VERSION
  checkout_from https://github.com/checkstyle/contribution
  cd .ci-temp/contribution/checkstyle-tester
  sed -i.'' 's/^guava/#guava/' projects-to-test-on.properties
  sed -i.'' 's/#guava|/guava|/' projects-to-test-on.properties
  cd ../../../
  mvn -e --no-transfer-progress clean install -Pno-validations
  cp src/main/resources/google_checks.xml .ci-temp/google_checks.xml
  sed -i.'' 's/warning/ignore/' .ci-temp/google_checks.xml
  cd .ci-temp/contribution/checkstyle-tester
  export MAVEN_OPTS="-Xmx2048m"
  groovy ./diff.groovy --listOfProjects projects-to-test-on.properties \
      --patchConfig ../../google_checks.xml \
      --mode single --allowExcludes -xm "-Dcheckstyle.failsOnError=false \
      -Dcheckstyle.version=${CS_POM_VERSION}" -p "$BRANCH" -r ../../..
  cd ../..
  removeFolderWithProtectedFiles contribution
  rm google_checks.*
  ;;

guava-with-sun-checks)
  CS_POM_VERSION="$(getCheckstylePomVersion)"
  BRANCH=$(git rev-parse --abbrev-ref HEAD)
  echo CS_version: $CS_POM_VERSION
  checkout_from https://github.com/checkstyle/contribution
  cd .ci-temp/contribution/checkstyle-tester
  sed -i.'' 's/^guava/#guava/' projects-to-test-on.properties
  sed -i.'' 's/#guava|/guava|/' projects-to-test-on.properties
  cd ../../../
  mvn -e --no-transfer-progress clean install -Pno-validations
  cp src/main/resources/sun_checks.xml .ci-temp/sun_checks.xml
  sed -i.'' 's/value=\"error\"/value=\"ignore\"/' .ci-temp/sun_checks.xml
  cd .ci-temp/contribution/checkstyle-tester
  export MAVEN_OPTS="-Xmx2048m"
  groovy ./diff.groovy --listOfProjects projects-to-test-on.properties \
      --patchConfig ../../sun_checks.xml \
      --mode single --allowExcludes -xm "-Dcheckstyle.failsOnError=false \
      -Dcheckstyle.version=${CS_POM_VERSION}"  -p "$BRANCH" -r ../../..
  cd ../..
  removeFolderWithProtectedFiles contribution
  rm sun_checks.*
  ;;

openjdk14-with-checks-nonjavadoc-error)
  LOCAL_GIT_REPO=$(pwd)
  BRANCH=$(git rev-parse --abbrev-ref HEAD)
  checkout_from https://github.com/checkstyle/contribution
  sed -i.'' 's/value=\"error\"/value=\"ignore\"/' \
        .ci-temp/contribution/checkstyle-tester/checks-nonjavadoc-error.xml
  cd .ci-temp/contribution/checkstyle-tester
  cp ../../../.ci/openjdk-projects-to-test-on.config openjdk-projects-to-test-on.config
  sed -i '/  <!-- Filters -->/r ../../../.ci/openjdk14-excluded.files' checks-nonjavadoc-error.xml
  export MAVEN_OPTS="-Xmx2048m"
  groovy ./diff.groovy --listOfProjects openjdk-projects-to-test-on.config \
      --mode single --allowExcludes \
      --patchConfig checks-nonjavadoc-error.xml \
      --localGitRepo  "$LOCAL_GIT_REPO" \
      --patchBranch "$BRANCH" -xm "-Dcheckstyle.failsOnError=false"

  cd ../../
  removeFolderWithProtectedFiles contribution
  ;;

no-exception-lucene-and-others)
  CS_POM_VERSION="$(getCheckstylePomVersion)"
  BRANCH=$(git rev-parse --abbrev-ref HEAD)
  echo 'CS_POM_VERSION='${CS_POM_VERSION}
  checkout_from https://github.com/checkstyle/contribution
  cd .ci-temp/contribution/checkstyle-tester
  sed -i'' 's/^guava/#guava/' projects-for-circle.properties
  sed -i'' 's/#infinispan/infinispan/' projects-for-circle.properties
  sed -i'' 's/#protonpack/protonpack/' projects-for-circle.properties
  sed -i'' 's/#jOOL/jOOL/' projects-for-circle.properties
  sed -i'' 's/#lucene-solr/lucene-solr/' projects-for-circle.properties
  export MAVEN_OPTS="-Xmx2048m"
  groovy ./diff.groovy --listOfProjects projects-for-circle.properties \
      --patchConfig checks-only-javadoc-error.xml \
      --mode single --allowExcludes -xm "-Dcheckstyle.failsOnError=false \
      -Dcheckstyle.version=${CS_POM_VERSION}"  -p "$BRANCH" -r ../../..
  cd ../..
  removeFolderWithProtectedFiles contribution
  ;;

no-exception-cassandra-storm-tapestry)
  CS_POM_VERSION="$(getCheckstylePomVersion)"
  echo 'CS_POM_VERSION='${CS_POM_VERSION}
  BRANCH=$(git rev-parse --abbrev-ref HEAD)
  checkout_from https://github.com/checkstyle/contribution
  cd .ci-temp/contribution/checkstyle-tester
  sed -i'' 's/^guava/#guava/' projects-for-circle.properties
  sed -i'' 's/#tapestry-5/tapestry-5/' projects-for-circle.properties
  sed -i'' 's/#storm/storm/' projects-for-circle.properties
  sed -i'' 's/#cassandra/cassandra/' projects-for-circle.properties
  export MAVEN_OPTS="-Xmx2048m"
  groovy ./diff.groovy --listOfProjects projects-for-circle.properties \
      --patchConfig checks-only-javadoc-error.xml \
      --mode single --allowExcludes  -xm "-Dcheckstyle.failsOnError=false \
      -Dcheckstyle.version=${CS_POM_VERSION}"  -p "$BRANCH" -r ../../..
  cd ../..
  removeFolderWithProtectedFiles contribution
  ;;

no-exception-hadoop-apache-groovy-scouter)
  CS_POM_VERSION="$(getCheckstylePomVersion)"
  echo 'CS_POM_VERSION='${CS_POM_VERSION}
  BRANCH=$(git rev-parse --abbrev-ref HEAD)
  checkout_from https://github.com/checkstyle/contribution
  cd .ci-temp/contribution/checkstyle-tester
  sed -i'' 's/^guava/#guava/' projects-for-circle.properties
  sed -i'' 's/#apache-commons/apache-commons/' projects-for-circle.properties
  sed -i'' 's/#hadoop/hadoop/' projects-for-circle.properties
  sed -i'' 's/#groovy/groovy/' projects-for-circle.properties
  sed -i'' 's/#scouter/scouter/' projects-for-circle.properties
  export MAVEN_OPTS="-Xmx2048m"
  groovy ./diff.groovy --listOfProjects projects-for-circle.properties \
      --patchConfig checks-only-javadoc-error.xml \
      --mode single --allowExcludes -xm "-Dcheckstyle.failsOnError=false \
      -Dcheckstyle.version=${CS_POM_VERSION}"  -p "$BRANCH" -r ../../..
  cd ../..
  removeFolderWithProtectedFiles contribution
  ;;

no-exception-only-javadoc)
  CS_POM_VERSION="$(getCheckstylePomVersion)"
  echo 'CS_POM_VERSION='${CS_POM_VERSION}
  BRANCH=$(git rev-parse --abbrev-ref HEAD)
  checkout_from https://github.com/checkstyle/contribution
  cd .ci-temp/contribution/checkstyle-tester
  sed -i.'' 's/^guava/#guava/' projects-to-test-on.properties
{'fraction_non_alphanumeric': 0.16576284904896804, 'fraction_numerical': 0.005018211250505868, 'mean_word_length': 3.422333571939871, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 14, 'lorem ipsum': 0, 'www.': 0, 'xml': 28}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2938185', 'n_tokens_mistral': 4681, 'n_tokens_neox': 4405, 'n_words': 677}