ligo/tools/lsp/squirrel/scripts/check-trailing-whitespace.sh
Anton Myasnikov 820d73f345
[LIGO-25] Chores (add Makefile, scripts, vendor, stylish)
Problem: We need to add stylish config to settle code style for our
project. Makefile to simplify its building. Also we need to check
our project for trailing whitespaces so we need to add the corresponding
script to be used later in CI.

Solution:
Add
  - stylish-haskell config
  - Makefile
  - `check_trailing_whitespace` script
2020-08-11 13:31:22 +03:00

15 lines
357 B
Bash
Executable File

#!/usr/bin/env bash
# SPDX-FileCopyrightText: 2020 Tocqueville Group
#
# SPDX-License-Identifier: LicenseRef-MIT-TQ
files=$(git ls-files | xargs grep --files-with-matches --binary-files=without-match '[[:blank:]]$')
if [[ -n $files ]];then
echo ' Files with trailing whitespace found:'
for f in "${files[@]}"; do
echo " * $f"
done
exit 1
fi