Skip to content

Commit

Permalink
chore: Updated pre-commit hooks to match java-repo-template
Browse files Browse the repository at this point in the history
Refs: #72
  • Loading branch information
pbezliapovich committed Oct 28, 2024
1 parent 3589f29 commit d57f126
Show file tree
Hide file tree
Showing 311 changed files with 377 additions and 390 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/maven-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ jobs:
MARKDOWN2HTML_MAVEN_PLUGIN_FAIL_ON_ERROR: true
steps:
- name: 📄 Checkout the repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0
- name: Set up JDK and Maven
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4
with:
distribution: adopt
java-version: 17
Expand All @@ -36,7 +36,7 @@ jobs:
github.sha }}" >> $GITHUB_OUTPUT
- name: 💾 Prepare cache using cache key
id: prepare-cache
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4
with:
path: |
/home/runner/.m2
Expand Down Expand Up @@ -110,14 +110,14 @@ jobs:
COM_SONATYPE_CENTRAL_POLARION_OPENSOURCE_GPG_PASSPHRASE: ${{ secrets.COM_SONATYPE_CENTRAL_POLARION_OPENSOURCE_GPG_PASSPHRASE }}
steps:
- name: 🧱 Set up JDK and Maven
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4
with:
distribution: adopt
java-version: 17
gpg-private-key: ${{ secrets.COM_SONATYPE_CENTRAL_POLARION_OPENSOURCE_GPG_PRIVATE_KEY }}
- name: 💾 Restore cache using cache key
id: restore-cache
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4
with:
path: |
/home/runner/.m2
Expand All @@ -140,13 +140,13 @@ jobs:
GITHUB_TOKEN: ${{ github.token }}
steps:
- name: 🧱 Set up JDK and Maven
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4
with:
distribution: adopt
java-version: 17
- name: 💾 Restore cache using cache key
id: restore-cache
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4
with:
path: |
/home/runner/.m2
Expand Down
20 changes: 6 additions & 14 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,23 @@
---
name: PR checks

on:
pull_request:
types:
- opened
- edited
- synchronize
- reopened
- unlocked

types: [opened, edited, synchronize, reopened, unlocked]
permissions:
contents: read

jobs:
check-conventional-commit:
name: Check commit messages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
ref: "${{ github.event.pull_request.head.ref }}"
repository: "${{ github.event.pull_request.head.repo.full_name }}"
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
fetch-depth: 0
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5
with:
cache: "pip" # caching pip dependencies
cache: pip # caching pip dependencies
- run: pip install commitizen
- name: Check commit messages
run: cz check --rev-range origin/${GITHUB_BASE_REF}..
2 changes: 1 addition & 1 deletion .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
steps:
- name: release-please
id: release
uses: googleapis/release-please-action@7987652d64b4581673a76e33ad5e98e3dd56832f # v4
uses: googleapis/release-please-action@7987652d64b4581673a76e33ad5e98e3dd56832f # v4
with:
release-type: maven
default-branch: main
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ bin
.settings

.idea
*.iml
*.iml
15 changes: 15 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,28 @@ repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-merge-conflict
- id: trailing-whitespace
- id: check-xml
- id: check-json
- id: check-yaml
- id: no-commit-to-branch
- id: mixed-line-ending
- id: end-of-file-fixer
- repo: local
hooks:
- id: sensitive-data-leak-urls
name: Sensitive data leak - URLs
entry: (?<!polarion-opensource@)(?<!www\.)sbb\.ch
language: pygrep
types: [text]
- id: sensitive-data-leak-ue-numbers
name: Sensitive data leak - UE numbers
entry: \b([uUeE]{1,2})\d{5,6}\b
language: pygrep
types: [text]
- repo: https://github.com/zricethezav/gitleaks
rev: v8.21.1
hooks:
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,4 +137,4 @@ Unsure where to begin contributing to Atom? You can start by looking through the

## Attribution

This CONTRIBUTING guideline is adapted from the [sbb-design-systems/sbb-angular](https://github.com/sbb-design-systems/sbb-angular)
This CONTRIBUTING guideline is adapted from the [sbb-design-systems/sbb-angular](https://github.com/sbb-design-systems/sbb-angular)
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public static void diffHTML(InputSource oldSource, InputSource newSource, Conten
/**
* Diffs two html files word for word as source, outputting the result to
* the specified consumer.
*/
*/
public static void diffTag(String oldText, String newText, ContentHandler consumer) throws Exception;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,4 @@ public void startElement(String namespaceURI, String localName,
flushCharacters();
consumer.startElement(namespaceURI, localName, qName, atts);
}
}
}
2 changes: 1 addition & 1 deletion src/main/java/org/outerj/daisy/diff/helper/SaxBuffer.java
Original file line number Diff line number Diff line change
Expand Up @@ -512,4 +512,4 @@ public void dump(Writer writer) throws IOException {
writer.write("IgnorableWhitespace] ch=" + new String(ch) + "\n");
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -239,4 +239,4 @@ private void addAttributes(Modification mod, AttributesImpl attrs) {

}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -476,4 +476,4 @@ public List<Modification> getLastModified() {
public void setLastModified(List<Modification> aLastModified) {
lastModified = new ArrayList<Modification>(aLastModified);
}
}
}
2 changes: 1 addition & 1 deletion src/main/java/org/outerj/daisy/diff/html/dom/Node.java
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public LastCommonParentResult getLastCommonParent(Node other) {
result.setIndexInLastCommonParent(
myParents.get(i - 1).getIndexOf(this));
} else if (myParents.size() > otherParents.size()) {
// All tags matched but there are tags left in this tree -
// All tags matched but there are tags left in this tree -
//other node is not so deeply nested
result.setIndexInLastCommonParent(
myParents.get(i - 1).getIndexOf(myParents.get(i)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
<tr width="50%">
<span class="diff-html-changed" id="changed-diff-0" changes="<ul class='changelist'><li>Moved out of a <b>row</b> with width 30%.</li><li>Moved to a <b>row</b> with width 50%.</li></ul>" previous="first-diff" changeId="changed-diff-0" next="last-diff">should always be</span>
</tr> given twice a week. </table>
</html>
</html>
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<html><head><link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/DaisyDiff/DaisyDiff@5f7a3960f531179f59b0abdf6947efb0b72eaaa6/css/diff.css"></link></head>
<p>The product <td width="50%"><span class="diff-html-changed" id="changed-diff-0" changes="<ul class='changelist'><li>Moved out of a <b>cell</b>.</li><li>Moved to a <b>cell</b> with width 50%.</li></ul>" previous="first-diff" changeId="changed-diff-0" next="last-diff">should always</span></td> be given twice a week.</p>
</html>
</html>
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<html><head><link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/DaisyDiff/DaisyDiff@5f7a3960f531179f59b0abdf6947efb0b72eaaa6/css/diff.css"></link></head>
<p>The product <td>should always<span class="diff-html-added" id="added-diff-0" previous="first-diff" changeId="added-diff-0" next="changed-diff-0"></span></td><span class="diff-html-changed" changes="Moved out of a <b>cell</b>." previous="added-diff-0" changeId="changed-diff-0" next="removed-diff-0"> </span><span class="diff-html-changed" id="changed-diff-0" changes="Moved out of a <b>cell</b>." previous="added-diff-0" changeId="changed-diff-0" next="removed-diff-0">be </span><span class="diff-html-removed" id="removed-diff-0" previous="changed-diff-0" changeId="removed-diff-0" next="last-diff"></span> given twice a week.</p>
</html>
</html>
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<html><head><link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/DaisyDiff/DaisyDiff@5f7a3960f531179f59b0abdf6947efb0b72eaaa6/css/diff.css"></link></head>
<p>The product <td width="50%"><span class="diff-html-changed" id="changed-diff-0" changes="<ul class='changelist'><li>Moved out of a <b>cell</b> with width 30%.</li><li>Moved to a <b>cell</b> with width 50%.</li></ul>" previous="first-diff" changeId="changed-diff-0" next="added-diff-0">should always</span><span class="diff-html-added" id="added-diff-0" previous="changed-diff-0" changeId="added-diff-0" next="changed-diff-1"></span></td><span class="diff-html-changed" changes="Moved out of a <b>cell</b> with width 30%." previous="added-diff-0" changeId="changed-diff-1" next="removed-diff-0"> </span><span class="diff-html-changed" id="changed-diff-1" changes="Moved out of a <b>cell</b> with width 30%." previous="added-diff-0" changeId="changed-diff-1" next="removed-diff-0">be </span><span class="diff-html-removed" id="removed-diff-0" previous="changed-diff-1" changeId="removed-diff-0" next="last-diff"></span> given twice a week.</p>
</html>
</html>
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<html><head><link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/DaisyDiff/DaisyDiff@5f7a3960f531179f59b0abdf6947efb0b72eaaa6/css/diff.css"></link></head>
<p>The product <td width="50%"><span class="diff-html-changed" id="changed-diff-0" changes="<ul class='changelist'><li>Moved out of a <b>cell</b> with width 30%.</li><li>Moved to a <b>cell</b> with width 50%.</li></ul>" previous="first-diff" changeId="changed-diff-0" next="added-diff-0">should </span><span class="diff-html-added" id="added-diff-0" previous="changed-diff-0" changeId="added-diff-0" next="changed-diff-1">always </span><span class="diff-html-changed" id="changed-diff-1" changes="<ul class='changelist'><li>Moved out of a <b>cell</b> with width 30%.</li><li>Moved to a <b>cell</b> with width 50%.</li></ul>" previous="added-diff-0" changeId="changed-diff-1" next="last-diff">be</span></td> given twice a week.</p>
</html>
</html>
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<html><head><link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/DaisyDiff/DaisyDiff@5f7a3960f531179f59b0abdf6947efb0b72eaaa6/css/diff.css"></link></head>
<p>This is a sample <b>sentence</b> with a last word <span class="diff-html-added" id="added-diff-0" previous="first-diff" changeId="added-diff-0" next="last-diff">change</span>.</p>
</html>
</html>
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<html><head><link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/DaisyDiff/DaisyDiff@5f7a3960f531179f59b0abdf6947efb0b72eaaa6/css/diff.css"></link></head>
<p>This is a sample <b>sentence</b> with patients<span class="diff-html-removed" previous="first-diff" changeId="removed-diff-0" next="last-diff"> </span><span class="diff-html-removed" id="removed-diff-0" previous="first-diff" changeId="removed-diff-0" next="last-diff">(CDC stage A)</span>.</p>
</html>
</html>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<html><head><link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/DaisyDiff/DaisyDiff@5f7a3960f531179f59b0abdf6947efb0b72eaaa6/css/diff.css"></link></head>
<p>This is a sample <b>sentence</b> with a full stop<span class="diff-html-removed" id="removed-diff-0" previous="first-diff" changeId="removed-diff-0" next="last-diff">.</span>
</p>
</html>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<ul>
<li>BA</li>
</ul>
</li>
<li>This is a ship</li>
</li>
<li>This is a ship</li>
</ul>

</body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<ul>
<li>BA</li>
</ul>
</li>
<li>This is a ship</li>
</li>
<li>This is a ship</li>
</ul>

</body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
<li>Olympic</li>
<li>BA</li>
</ul>
</li>
<li>What about a skateboard?</li>
<li>This ain't a ship</li>
</li>
<li>What about a skateboard?</li>
<li>This ain't a ship</li>
</ul>

</body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
<li>Olympic</li>
<li>BA</li>
</ul>
</li>
<li>What about a skateboard?</li>
<li>This ain't a ship</li>
</li>
<li>What about a skateboard?</li>
<li>This ain't a ship</li>
</ul>

</body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@
<li>
<span class="diff-html-added" previous="removed-diff-1" changeId="added-diff-3" next="last-diff">This ain't </span><span class="diff-html-removed" id="removed-diff-1" previous="added-diff-2" changeId="removed-diff-1" next="added-diff-3">This is </span>a ship</li>
</ul>
</html>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
<p>The product should always <br>
<span class="diff-html-removed" id="removed-diff-0" previous="first-diff" changeId="removed-diff-0" next="last-diff"></span>
</br> be given twice a week.</p>
</html>
</html>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<html>
<body>
<p> This &amp; is a &lt; test</p>
<p> This &amp; is a &lt; test</p>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<html>
<body>
<p> This &amp; is a &lt; test</p>
<p> This &amp; is a &lt; test</p>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<html>
<body>
<p> This &amp; is a &lt; test &lt; more</p>
<p> This &amp; is a &lt; test &lt; more</p>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<html>
<body>
<p> This &amp; is a &lt; test &lt; more</p>
<p> This &amp; is a &lt; test &lt; more</p>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<html><head><link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/DaisyDiff/DaisyDiff@5f7a3960f531179f59b0abdf6947efb0b72eaaa6/css/diff.css"></link></head>
<p> This &amp; is a &lt; test <span class="diff-html-added" id="added-diff-0" previous="first-diff" changeId="added-diff-0" next="last-diff">&lt; more</span>
</p>
</html>
</html>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<html>
<body>
<p> &Gamma;&Theta;&Xi;</p>
<p> &Gamma;&Theta;&Xi;</p>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<html>
<body>
<p> &Gamma;&Theta;&Xi;</p>
<p> &Gamma;&Theta;&Xi;</p>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<html>
<body>
<p> &Gamma;&Theta;&Xi;&Sigma;</p>
<p> &Gamma;&Theta;&Xi;&Sigma;</p>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<html>
<body>
<p> &Gamma;&Theta;&Xi;&Sigma;</p>
<p> &Gamma;&Theta;&Xi;&Sigma;</p>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
 <p>
<span class="diff-html-removed" previous="first-diff" changeId="removed-diff-0" next="added-diff-0"> </span><span class="diff-html-removed" id="removed-diff-0" previous="first-diff" changeId="removed-diff-0" next="added-diff-0">ΓΘΞ</span><span class="diff-html-added" previous="removed-diff-0" changeId="added-diff-0" next="last-diff"> </span><span class="diff-html-added" id="added-diff-0" previous="removed-diff-0" changeId="added-diff-0" next="last-diff">ΓΘΞΣ</span>
</p>
</html>
</html>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<html>
<body>
<p> Ελληνική λέξη</p>
<p> Ελληνική λέξη</p>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<html>
<body>
<p> Ελληνική λέξη</p>
<p> Ελληνική λέξη</p>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<html>
<body>
<p> Ελληνική λέξης</p>
<p> Ελληνική λέξης</p>
</body>
</html>
Loading

0 comments on commit d57f126

Please sign in to comment.