Skip to content

Commit

Permalink
add a proposed trailing whitespace check
Browse files Browse the repository at this point in the history
  • Loading branch information
bunnie committed Jan 11, 2024
1 parent 99a2381 commit da60e82
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/trailing_whitespace_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# From https://github.com/samblenny/autofmt-demo/blob/main/.github/workflows/trailing_whitespace_check.yml
name: trailing_whitespace_check
on: push
jobs:
trailing_whitespace_check:
runs-on: ubuntu-latest
steps:
- name: Check out branch source
uses: actions/checkout@v4

- name: Check .rs files for trailing whitespace
run: >
find . -name '*.rs' -print0
| xargs -0 grep -c --with-filename '[ \t]$'
| grep -v ':0$'
| perl -e 'while(<>){print;$n+=1};if($n>0){exit 1;};print "PASS\n";'

0 comments on commit da60e82

Please sign in to comment.