-
Notifications
You must be signed in to change notification settings - Fork 0
/
format.sh
41 lines (28 loc) · 836 Bytes
/
format.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
33
34
35
36
37
38
39
40
41
#!/usr/bin/env bash
source bash-toolbox/init.sh
include command.validator.CommandValidator
include formatter.Formatter
include logger.Logger
include props.reader.util.PropsReaderUtil
include string.util.StringUtil
_main(){
local _log="Logger log"
_log info "validating_formatting_rules..."
local files=($(find * -type f -iname "*.sh"))
local skipVariableValidation=$(PropsReaderUtil
readProps $(pwd)/formatter.properties ignore_local_variables)
local tasks=($(CommandValidator
getValidFunctions bash-toolbox/formatter/Formatter.sh))
for file in ${files[@]}; do
for task in $(StringUtil strip tasks Formatter); do
if [[ ${task} == enforceLocalVariables &&
${skipVariableValidation} =~ ${file} ]]; then
continue
else
Formatter ${task} ${file}
fi
done
done
${_log} info "completed"
}
_main