mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2025-12-20 06:50:05 +01:00
gitlab CI: add a job to check for whitespace issues
Trailing whitespaces and tab after a space are a no-go. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
6ae0d1bac4
commit
bb6ff0ec00
2 changed files with 46 additions and 0 deletions
|
|
@ -186,6 +186,29 @@ check-commit:
|
||||||
reports:
|
reports:
|
||||||
junit: results.xml
|
junit: results.xml
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# Check for trailing whitespaces
|
||||||
|
#
|
||||||
|
|
||||||
|
check-whitespace:
|
||||||
|
extends:
|
||||||
|
- .fdo.ci-fairy
|
||||||
|
stage: sanity check
|
||||||
|
script:
|
||||||
|
# remove trailing whitespaces
|
||||||
|
- sed -i 's/ *$//' $(git ls-files)
|
||||||
|
- git diff --exit-code || (echo "ERROR - Trailing whitespaces in patchset, please fix" && false)
|
||||||
|
- sed -i 's/\t*$//' $(git ls-files)
|
||||||
|
- git diff --exit-code || (echo "ERROR - Trailing tabs in patchset, please fix" && false)
|
||||||
|
# search for tab after space
|
||||||
|
- sed -i 's/ \t//' $(git ls-files)
|
||||||
|
- git diff --exit-code || (echo "ERROR - Tab after space in patchset, please fix" && false)
|
||||||
|
# search for duplicated empty lines
|
||||||
|
- sed -i '/^$/N;/^\n$/D' $(git ls-files src/*.{h,c} tools/*.{h,c} udev/*.c)
|
||||||
|
- git diff --exit-code || (echo "ERROR - Duplicated empty lines, please fix" && false)
|
||||||
|
|
||||||
|
|
||||||
#################################################################
|
#################################################################
|
||||||
# #
|
# #
|
||||||
# prep stage #
|
# prep stage #
|
||||||
|
|
|
||||||
|
|
@ -174,6 +174,29 @@ check-commit:
|
||||||
reports:
|
reports:
|
||||||
junit: results.xml
|
junit: results.xml
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# Check for trailing whitespaces
|
||||||
|
#
|
||||||
|
|
||||||
|
check-whitespace:
|
||||||
|
extends:
|
||||||
|
- .fdo.ci-fairy
|
||||||
|
stage: sanity check
|
||||||
|
script:
|
||||||
|
# remove trailing whitespaces
|
||||||
|
- sed -i 's/ *$//' $(git ls-files)
|
||||||
|
- git diff --exit-code || (echo "ERROR - Trailing whitespaces in patchset, please fix" && false)
|
||||||
|
- sed -i 's/\t*$//' $(git ls-files)
|
||||||
|
- git diff --exit-code || (echo "ERROR - Trailing tabs in patchset, please fix" && false)
|
||||||
|
# search for tab after space
|
||||||
|
- sed -i 's/ \t//' $(git ls-files)
|
||||||
|
- git diff --exit-code || (echo "ERROR - Tab after space in patchset, please fix" && false)
|
||||||
|
# search for duplicated empty lines
|
||||||
|
- sed -i '/^$/N;/^\n$/D' $(git ls-files src/*.{h,c} tools/*.{h,c} udev/*.c)
|
||||||
|
- git diff --exit-code || (echo "ERROR - Duplicated empty lines, please fix" && false)
|
||||||
|
|
||||||
|
|
||||||
#################################################################
|
#################################################################
|
||||||
# #
|
# #
|
||||||
# prep stage #
|
# prep stage #
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue