forked from demisto/content
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlinters_runner.sh
More file actions
executable file
·26 lines (18 loc) · 1.09 KB
/
Copy pathlinters_runner.sh
File metadata and controls
executable file
·26 lines (18 loc) · 1.09 KB
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
#!/bin/bash
# Run flake8 pylint and mypy on all excluding Packs, (Integraions and Scripts) - they will be handled in linting
errors=0
all_dirs=$(find . -type d -not \( -path "*cache*" -o -path "./.*" -o -path "./Templates*" -o -path "./TestPlaybooks*" -o -path "./node_modules*" -o -path "./venv*" -o -path "./Packs*" -o -path "*infrastructure_tests*" -o -path "*scripts/awsinstancetool*" -o -path "./docs*" \))
all_1_depth_dirs=$(find . -maxdepth 1 -type d -not \( -path "*cache*" -o -path . -o -path ./Packs -o -path ./venv -o -path ./Templates -o -path ./TestPlaybooks -o -path ./node_modules -o -path "./.*" -o -path ./docs \))
echo -e "Top level folders to scan (used by flake8):\n${all_1_depth_dirs}\n"
echo -e "Folders to be used for lint scan (used by pylint and mypy):\n${all_dirs}\n"
# run mypy
./Tests/scripts/mypy.sh $all_dirs || errors=$?
# run pylint
./Tests/scripts/pylint.sh $all_dirs || errors=$?
# run flake8
./Tests/scripts/pyflake.sh *.py || errors=$?
./Tests/scripts/pyflake.sh $all_1_depth_dirs || errors=$?
echo 'Linter exit code:' $errors
if [[ $errors -ne 0 ]]; then
exit 1
fi