File tree Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,20 @@ function main {
17
17
# shellcheck disable=SC2178 # It's the simplest syntax for that case
18
18
ARGS=${ARGS[*]/ __GIT_WORKING_DIR__/ $(pwd)\/ }
19
19
# shellcheck disable=SC2128 # It's the simplest syntax for that case
20
+
21
+ # Run `tflint --init` for check that plugins installed.
22
+ # It should run once on whole repo.
23
+ {
24
+ TFLINT_INIT=$( tflint --init 2>&1 ) 2> /dev/null &&
25
+ common::colorify " green" " Command 'tflint --init' successfully done:" &&
26
+ echo -e " ${TFLINT_INIT} \n\n\n"
27
+ } || {
28
+ local exit_code=$?
29
+ common::colorify " red" " Command 'tflint --init' failed:"
30
+ echo " ${TFLINT_INIT} "
31
+ return ${exit_code}
32
+ }
33
+
20
34
common::per_dir_hook " $ARGS " " $HOOK_ID " " ${FILES[@]} "
21
35
}
22
36
@@ -34,13 +48,6 @@ function per_dir_hook_unique_part {
34
48
local -r args=" $1 "
35
49
local -r dir_path=" $2 "
36
50
37
- # shellcheck disable=SC2091,SC2068 # Suppress error output
38
- TFLINT_INIT=$( tflint --init 2>&1 ) 2> /dev/null || {
39
- local exit_code=$?
40
- common:colorify " yellow" " tflint init:"
41
- echo " ${TFLINT_INIT} "
42
- return ${exit_code}
43
- }
44
51
# Print checked PATH **only** if TFLint have any messages
45
52
# shellcheck disable=SC2091,SC2068 # Suppress error output
46
53
$( tflint ${args[@]} 2>&1 ) 2> /dev/null || {
You can’t perform that action at this time.
0 commit comments