mirror of
https://github.com/super-linter/super-linter.git
synced 2024-12-22 12:42:09 -05:00
e0d8b4fb2f
Implement a linter to check if files contain Git conflict markers or whitespace errors.
19 lines
350 B
Bash
Executable file
19 lines
350 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
set -o errexit
|
|
set -o nounset
|
|
set -o pipefail
|
|
|
|
GIT_MERGE_CONFLICT_EXPRESSION='^(<<<<<<<|=======|>>>>>>>)'
|
|
|
|
if [[ "$*" == "--version" ]]; then
|
|
echo "1.0.0"
|
|
exit 0
|
|
fi
|
|
|
|
if grep -l -E "${GIT_MERGE_CONFLICT_EXPRESSION}" "$@"; then
|
|
echo "Found Git merge conflict markers"
|
|
exit 1
|
|
else
|
|
echo "No merge conflicts found in $*"
|
|
fi
|