-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
141 additions
and
131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: "Pre-commit consistency check" | ||
name: Pre-commit consistency check | ||
|
||
on: | ||
workflow_dispatch: | ||
|
@@ -13,29 +13,29 @@ jobs: | |
name: Run pre-commit checks | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: dorny/paths-filter@v2 | ||
id: filter | ||
with: | ||
list-files: shell | ||
filters: | | ||
addedOrModified: | ||
- added|modified: '**' | ||
- uses: dorny/paths-filter@v2 | ||
id: filter | ||
with: | ||
list-files: shell | ||
filters: | | ||
addedOrModified: | ||
- added|modified: '**' | ||
# run only if changed files were detected | ||
- name: Run against changes | ||
uses: pre-commit/[email protected] | ||
if: steps.filter.outputs.addedOrModified == 'true' | ||
with: | ||
extra_args: --files ${{ steps.filter.outputs.addedOrModified_files }} | ||
- name: Run against changes | ||
uses: pre-commit/[email protected] | ||
if: steps.filter.outputs.addedOrModified == 'true' | ||
with: | ||
extra_args: --files ${{ steps.filter.outputs.addedOrModified_files }} | ||
|
||
# run if no changed files were detected (e.g. workflow_dispatch on master branch) | ||
- name: Run against all files | ||
uses: pre-commit/[email protected] | ||
if: steps.filter.outputs.addedOrModified != 'true' | ||
with: | ||
extra_args: --all-files | ||
- name: Run against all files | ||
uses: pre-commit/[email protected] | ||
if: steps.filter.outputs.addedOrModified != 'true' | ||
with: | ||
extra_args: --all-files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,27 @@ | ||
# See https://pre-commit.com for more information | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.0.1 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
- id: fix-byte-order-marker | ||
- id: mixed-line-ending | ||
- id: check-merge-conflict | ||
- id: check-case-conflict | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.0.1 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
- id: fix-byte-order-marker | ||
- id: mixed-line-ending | ||
- id: check-merge-conflict | ||
- id: check-case-conflict | ||
|
||
- repo: https://github.com/Lucas-C/pre-commit-hooks | ||
rev: v1.1.10 | ||
hooks: | ||
- id: remove-crlf | ||
- id: remove-tabs | ||
- repo: https://github.com/Lucas-C/pre-commit-hooks | ||
rev: v1.1.10 | ||
hooks: | ||
- id: remove-crlf | ||
- id: remove-tabs | ||
|
||
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks | ||
rev: v2.13.0 | ||
hooks: | ||
- id: pretty-format-java | ||
args: [--autofix] | ||
- id: pretty-format-yaml | ||
args: [--autofix] | ||
- id: pretty-format-toml | ||
args: [--autofix] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters