sevntu-checkstyle / sevntu.checkstyle

Additional Checkstyle checks, that could be added as extension to EclipseCS plugin and maven-checkstyle-plugin, Sonar checkstyle plugin, extension for CheckStyle IDEA plugin.
http://sevntu-checkstyle.github.io/sevntu.checkstyle/
190 stars 146 forks source link

Issue #915: correct handling of checkstyle.ant.skip #917

Closed rnveach closed 2 years ago

rnveach commented 2 years ago

The Ant manual Property Task states:

Properties are immutable: whoever sets a property first freezes it for the rest of the build; they are most definitely not variables.

I created a intermediator variable to handle to make the conditions easier and make handling same as original.

rnveach commented 2 years ago

Runs with output of properties before and after condition for just first (second has same logic just no displays):

    <echo level="info">${checkstyle.ant.skip}</echo>
    <echo level="info">${run}</echo>

mvn -e --no-transfer-progress verify -DskipTests

[INFO] --- maven-antrun-plugin:3.1.0:run (ant-phase-verify) @ sevntu-checks ---
[INFO] Executing tasks
[INFO]      [echo] ${checkstyle.ant.skip}
[INFO]      [echo] ${run}
[INFO]      [echo] ${checkstyle.ant.skip}
[INFO]      [echo] true
[INFO]      [echo] Checkstyle started (https://raw.githubusercontent.com/checkstyle/checkstyle/checkstyle-10.3.4/config/checkstyle_checks.xml): 23/10/2022 11:27:23 AM
[INFO] [checkstyle] Running Checkstyle 10.3.4 on 141 files
[INFO]      [echo] Checkstyle finished (https://raw.githubusercontent.com/checkstyle/checkstyle/checkstyle-10.3.4/config/checkstyle_checks.xml) : 23/10/2022 11:27:26 AM
[INFO] Executed tasks
[INFO]
[INFO] --- maven-antrun-plugin:3.1.0:run (ant-phase-verify-sevntu) @ sevntu-checks ---
[INFO] Executing tasks
[INFO]      [echo] Checkstyle started (M:\checkstyleWorkspaceEclipse\sevntu\sevntu-checks\sevntu-checks.xml): 23/10/2022 11:27:26 AM
[INFO] [checkstyle] Running Checkstyle 10.3.4 on 141 files
[INFO]      [echo] Checkstyle finished (M:\checkstyleWorkspaceEclipse\sevntu\sevntu-checks\sevntu-checks.xml) : 23/10/2022 11:27:30 AM
[INFO] Executed tasks

mvn -e --no-transfer-progress verify -DskipTests -D"checkstyle.ant.skip=true"

[INFO] --- maven-antrun-plugin:3.1.0:run (ant-phase-verify) @ sevntu-checks ---
[INFO] Executing tasks
[INFO]      [echo] true
[INFO]      [echo] ${run}
[INFO]      [echo] true
[INFO]      [echo] ${run}
[INFO] Executed tasks
[INFO]
[INFO] --- maven-antrun-plugin:3.1.0:run (ant-phase-verify-sevntu) @ sevntu-checks ---
[INFO] Executing tasks
[INFO] Executed tasks

mvn -e --no-transfer-progress verify -DskipTests -D"checkstyle.ant.skip=false"

[INFO] --- maven-antrun-plugin:3.1.0:run (ant-phase-verify) @ sevntu-checks ---
[INFO] Executing tasks
[INFO]      [echo] false
[INFO]      [echo] ${run}
[INFO]      [echo] false
[INFO]      [echo] true
[INFO]      [echo] Checkstyle started (https://raw.githubusercontent.com/checkstyle/checkstyle/checkstyle-10.3.4/config/checkstyle_checks.xml): 23/10/2022 11:29:19 AM
[INFO] [checkstyle] Running Checkstyle 10.3.4 on 141 files
[INFO]      [echo] Checkstyle finished (https://raw.githubusercontent.com/checkstyle/checkstyle/checkstyle-10.3.4/config/checkstyle_checks.xml) : 23/10/2022 11:29:22 AM
[INFO] Executed tasks
[INFO]
[INFO] --- maven-antrun-plugin:3.1.0:run (ant-phase-verify-sevntu) @ sevntu-checks ---
[INFO] Executing tasks
[INFO]      [echo] Checkstyle started (M:\checkstyleWorkspaceEclipse\sevntu\sevntu-checks\sevntu-checks.xml): 23/10/2022 11:29:22 AM
[INFO] [checkstyle] Running Checkstyle 10.3.4 on 141 files
[INFO]      [echo] Checkstyle finished (M:\checkstyleWorkspaceEclipse\sevntu\sevntu-checks\sevntu-checks.xml) : 23/10/2022 11:29:26 AM
[INFO] Executed tasks

mvn -e --no-transfer-progress -Pno-validations verify -D"checkstyle.ant.skip=false" (command from checkstyle at https://github.com/checkstyle/checkstyle/pull/12339/files )

[INFO] --- maven-antrun-plugin:3.1.0:run (ant-phase-verify) @ sevntu-checks ---
[INFO] Executing tasks
[INFO]      [echo] false
[INFO]      [echo] ${run}
[INFO]      [echo] false
[INFO]      [echo] true
[INFO]      [echo] Checkstyle started (https://raw.githubusercontent.com/checkstyle/checkstyle/checkstyle-10.3.4/config/checkstyle_checks.xml): 23/10/2022 11:31:11 AM
[INFO] [checkstyle] Running Checkstyle 10.3.4 on 141 files
[INFO]      [echo] Checkstyle finished (https://raw.githubusercontent.com/checkstyle/checkstyle/checkstyle-10.3.4/config/checkstyle_checks.xml) : 23/10/2022 11:31:14 AM
[INFO] Executed tasks
[INFO]
[INFO] --- maven-antrun-plugin:3.1.0:run (ant-phase-verify-sevntu) @ sevntu-checks ---
[INFO] Executing tasks
[INFO]      [echo] Checkstyle started (M:\checkstyleWorkspaceEclipse\sevntu\sevntu-checks\sevntu-checks.xml): 23/10/2022 11:31:14 AM
[INFO] [checkstyle] Running Checkstyle 10.3.4 on 141 files
[INFO]      [echo] Checkstyle finished (M:\checkstyleWorkspaceEclipse\sevntu\sevntu-checks\sevntu-checks.xml) : 23/10/2022 11:31:17 AM
[INFO] Executed tasks
rnveach commented 2 years ago

CI run

Skip https://app.travis-ci.com/github/sevntu-checkstyle/sevntu.checkstyle/jobs/586419864#L424

Execute https://app.travis-ci.com/github/sevntu-checkstyle/sevntu.checkstyle/jobs/586419864#L872

coveralls commented 2 years ago

Coverage Status

Coverage remained the same at 98.798% when pulling 6ba50c1ebcd60fa08e0aa38fde68ed7ccce3fe07 on rnveach:issue_915_2 into eb45480f255354be534ab77f643aecfcbe4c8b7b on sevntu-checkstyle:master.