Skip to content

Commit

Permalink
Added check for new lines at the end of files in GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
percona-ysorokin committed Mar 22, 2024
1 parent d4bae0e commit c3e8190
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ jobs:
fetch-depth: 0
fetch-tags: true

- name: Check for new lines at the end of files
# https://medium.com/@alexey.inkin/how-to-force-newline-at-end-of-files-and-why-you-should-do-it-fdf76d1d090e
working-directory: ${{github.workspace}}/src
run: find . -type f -not -path "./.git/*" | xargs -L1 bash -c 'test $(tail -c1 "$0") && echo "No newline at end of $0"'

- name: Check formatting with git diff --check
working-directory: ${{github.workspace}}/src
run: git diff --check --color HEAD~
Expand Down

0 comments on commit c3e8190

Please sign in to comment.