mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 09:46:02 +02:00
15 lines
443 B
Bash
15 lines
443 B
Bash
![]() |
#!/bin/bash
|
||
|
|
||
|
set -e
|
||
|
|
||
|
##
|
||
|
# Remove trailing whitespace.
|
||
|
# The .gitattributes is used as a filter to identify files to check. Patters with
|
||
|
# this "# check trailing whitespace" on the line before are checked
|
||
|
##
|
||
|
awk '/# remove trailing whitespace/{getline; print $1}' .gitattributes |
|
||
|
while read i ; do
|
||
|
echo "Removing trailing whitespace on $i files"
|
||
|
git ls-files -- "$i" | xargs --no-run-if-empty sed -i 's/[ \t]*$//'
|
||
|
done
|