-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
lint.sh
executable file
·32 lines (24 loc) · 1.01 KB
/
lint.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
cd "${GITHUB_WORKSPACE}" || exit 1
# https://github.com/reviewdog/reviewdog/issues/1158
git config --global --add safe.directory "$GITHUB_WORKSPACE" || exit 1
export REVIEWDOG_GITHUB_API_TOKEN="${INPUT_GITHUB_TOKEN}"
sources=$(find "${INPUT_PATH}" -not -path "${INPUT_EXCLUDE}" -type f -name "${INPUT_PATTERN}")
echo "::group::Files to lint"
echo "${sources}"
echo "::endgroup::"
clj -Sdeps '{:deps {clj-kondo/clj-kondo {:mvn/version "RELEASE"}}}' -M -m clj-kondo.main \
--lint $(find "${INPUT_PATH}" -not -path "${INPUT_EXCLUDE}" -type f -name "${INPUT_PATTERN}") \
--config "${INPUT_CLJ_KONDO_CONFIG}" \
--config '{:output {:pattern "{{filename}}:{{row}}:{{col}}: {{message}}"}}' \
--config '{:summary false}' \
| reviewdog \
-efm="%f:%l:%c: %m" \
-name="clj-kondo" \
-reporter="${INPUT_REPORTER}" \
-filter-mode="${INPUT_FILTER_MODE}" \
-fail-on-error="${INPUT_FAIL_ON_ERROR}" \
-level="${INPUT_LEVEL}" \
"${INPUT_REVIEWDOG_FLAGS}"
exit_code=$?
exit $exit_code