Skip to content

Fix duplicate XSLT variable declaration in prepare_checkstyle.xslt#505

Closed
Copilot wants to merge 3 commits into
mainfrom
copilot/fix-only-tab-indentation-check
Closed

Fix duplicate XSLT variable declaration in prepare_checkstyle.xslt#505
Copilot wants to merge 3 commits into
mainfrom
copilot/fix-only-tab-indentation-check

Conversation

Copilot AI commented Dec 1, 2025

Copy link
Copy Markdown
  • Fix duplicate variable declaration in prepare_checkstyle.xslt
  • Add unit tests for XSLT transformation (PrepareCheckstyleXsltTest)
    • Test resource file path extraction (OH-INF files)
    • Test Java file path extraction
    • Test Windows path handling with backslashes
    • Test multiple files with errors
    • Test files without errors are excluded
  • All 14 tests pass
  • Code review completed
  • CodeQL security scan passed
Original prompt

This section details on the original issue you should resolve

<issue_title>OnlyTabIndentationCheck does not report file name</issue_title>
<issue_description>We have currently 2 files in the add-on repo causing OnlyTabIndentationCheck to be reported. The problem that the violation is just counted in the overview, but the file name is not reported.

Image

Affected files:
org.openhab.automation.jsscripting/src/main/resources/OH-INF/config/config.xml
org.openhab.binding.huesync/src/main/resources/OH-INF/thing/channel-types.xml

Checking the intermediate files in target folder, an entry in merge.xml is made.


   <message tool="checkstyle" line="45" message="There were whitespace characters used for indentation. Please use tab characters instead" priority="1" rule="OnlyTabIndentationCheck" category="style"/>


In contrast to other entries, the <file> section around this message is missing.</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: wborn <12213581+wborn@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix OnlyTabIndentationCheck to report file names Fix duplicate XSLT variable declaration in prepare_checkstyle.xslt Dec 1, 2025
Copilot AI requested a review from wborn December 1, 2025 07:26
@wborn wborn requested a review from Copilot December 1, 2025 08:33
@wborn

wborn commented Dec 1, 2025

Copy link
Copy Markdown
Member

Can you also add a unit test for this @copilot?

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a duplicate variable declaration in the XSLT 1.0 transformation file that was causing file names to be omitted from the "Summary Files" section when OnlyTabIndentationCheck violations were detected.

  • Renamed the first transformation variable from temp_name to temp_name1 to avoid duplicate declaration
  • Ensured XSLT 1.0 compliance for strict processors while maintaining backwards compatibility with Saxon

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: wborn <12213581+wborn@users.noreply.github.com>

Copilot AI commented Dec 1, 2025

Copy link
Copy Markdown
Author

Can you also add a unit test for this @copilot?

Added PrepareCheckstyleXsltTest with 5 unit tests that verify the XSLT transformation handles:

  • Resource file paths (OH-INF/config files)
  • Java file paths
  • Windows paths with backslashes
  • Multiple files with errors
  • Files without errors being excluded

Commit: 716de14

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • openhab.jfrog.io
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.11/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.11/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.11 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.11/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/static-code-analysis/static-code-analysis org.codehaus.plexus.classworlds.launcher.Launcher test -pl sat-plugin -Dtest=PrepareCheckstyleXsltTest -Denforcer.skip=true (dns block)
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.11/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.11/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.11 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.11/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/static-code-analysis/static-code-analysis org.codehaus.plexus.classworlds.launcher.Launcher spotless:apply -pl sat-plugin -Denforcer.skip=true (dns block)
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.11/a2d47e15/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.11/a2d47e15/bin/m2.conf -Dmaven.home=/home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.11/a2d47e15 -Dlibrary.jansi.path=/home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.11/a2d47e15/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/static-code-analysis/static-code-analysis org.codehaus.plexus.classworlds.launcher.Launcher -f pom.xml -B -V -e -Dfindbugs.skip -Dcheckstyle.skip -Dpmd.skip=true -Dspotbugs.skip -Denforcer.skip -Dmaven.javadoc.skip (dns block)
  • www.puppycrawl.com
    • Triggering command: /opt/hostedtoolcache/CodeQL/2.23.3/x64/codeql/tools/linux64/java/bin/java /opt/hostedtoolcache/CodeQL/2.23.3/x64/codeql/tools/linux64/java/bin/java -jar /opt/hostedtoolcache/CodeQL/2.23.3/x64/codeql/xml/tools/xml-extractor.jar --fileList=/home/REDACTED/work/static-code-analysis/.codeql-scratch/dbs/java/working/files-to-index3118487249796612212.list --sourceArchiveDir=/home/REDACTED/work/static-code-analysis/.codeql-scratch/dbs/java/src --outputDir=/home/REDACTED/work/static-code-analysis/.codeql-scratch/dbs/java/trap/java (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@wborn

wborn commented Dec 3, 2025

Copy link
Copy Markdown
Member

Thank you for your efforts @copilot.

@wborn wborn closed this Dec 3, 2025
@wborn wborn deleted the copilot/fix-only-tab-indentation-check branch December 3, 2025 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OnlyTabIndentationCheck does not report file name

3 participants