Skip to content

Commit

Permalink
chore: add a fix for the terrible default autocrlf setting git does
Browse files Browse the repository at this point in the history
  • Loading branch information
sekwah41 committed Jun 16, 2024
1 parent 6022e4c commit fb3ffef
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 52 deletions.
4 changes: 2 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Set default behaviour to maintain line endings
* -text
# Set default behaviour to maintain line endings
* -text
100 changes: 50 additions & 50 deletions .github/workflows/pre-commit-check.yaml
Original file line number Diff line number Diff line change
@@ -1,50 +1,50 @@
name: Pre-commit consistency check

on:
workflow_dispatch:
pull_request:
types: [labeled, opened, reopened, synchronize]
push:
branches: [spigot, re-recode]

concurrency:
group: ${{ github.head_ref }}-precommit
cancel-in-progress: true

jobs:
pre-commit-check:
if: "github.event.action != 'labeled' || github.event.label.name == 'pre-commit ci run'"
name: Run pre-commit checks
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- run: gh pr edit ${{ github.event.number }} --remove-label 'pre-commit ci run'
if: github.event.action == 'labeled' && github.event.label.name == 'pre-commit ci run'
env:
GH_TOKEN: ${{ github.token }}
- 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 }}

# 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
- uses: pre-commit-ci/[email protected]
if: always()
name: Pre-commit consistency check

on:
workflow_dispatch:
pull_request:
types: [labeled, opened, reopened, synchronize]
push:
branches: [spigot, re-recode]

concurrency:
group: ${{ github.head_ref }}-precommit
cancel-in-progress: true

jobs:
pre-commit-check:
if: github.event.action != 'labeled' || github.event.label.name == 'pre-commit ci run'
name: Run pre-commit checks
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- run: gh pr edit ${{ github.event.number }} --remove-label 'pre-commit ci run'
if: github.event.action == 'labeled' && github.event.label.name == 'pre-commit ci run'
env:
GH_TOKEN: ${{ github.token }}
- 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 }}

# 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
- uses: pre-commit-ci/[email protected]
if: always()

0 comments on commit fb3ffef

Please sign in to comment.