Skip to content

Commit c59b8dd

Browse files
Shellcheck (#2775)
* shell check Signed-off-by: pranjalg1331 <[email protected]> * all branchced Signed-off-by: pranjalg1331 <[email protected]> * cicd toolbox Signed-off-by: pranjalg1331 <[email protected]> * script changes part1 Signed-off-by: pranjalg1331 <[email protected]> * script changes part2 Signed-off-by: pranjalg1331 <[email protected]> * bad script Signed-off-by: pranjalg1331 <[email protected]> * script corrections Signed-off-by: pranjalg1331 <[email protected]> * remove sample Signed-off-by: pranjalg1331 <[email protected]> * last script Signed-off-by: pranjalg1331 <[email protected]> * start Signed-off-by: pranjalg1331 <[email protected]> * pre commit Signed-off-by: pranjalg1331 <[email protected]> * update pre commit Signed-off-by: pranjalg1331 <[email protected]> * start script error Signed-off-by: pranjalg1331 <[email protected]> * start update Signed-off-by: pranjalg1331 <[email protected]> * error correct Signed-off-by: pranjalg1331 <[email protected]> * watchman script change Signed-off-by: pranjalg1331 <[email protected]> * linter Signed-off-by: pranjalg1331 <[email protected]> * Update docker/scripts/watchman_install.sh Co-authored-by: Federico Gibertoni <[email protected]> * Update docker/scripts/watchman_install.sh Co-authored-by: Federico Gibertoni <[email protected]> * Update docker/scripts/watchman_install.sh Co-authored-by: Federico Gibertoni <[email protected]> --------- Signed-off-by: pranjalg1331 <[email protected]> Co-authored-by: Federico Gibertoni <[email protected]>
1 parent 7fd9a4e commit c59b8dd

File tree

32 files changed

+112
-87
lines changed

32 files changed

+112
-87
lines changed

.github/workflows/pull_request_automation.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ jobs:
5757
- name: isort
5858
run: |
5959
isort . --profile black --filter-files --check-only --diff --skip configuration/ldap_config.py
60+
61+
- name: Perform ShellCheck Analysis
62+
run: bash <(curl -s https://raw.githubusercontent.com/CICDToolbox/shellcheck/master/pipeline.sh)
6063

6164
backend-tests:
6265
runs-on: ubuntu-latest

.pre-commit-config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,8 @@ repos:
5050
5151
args: ["--fix"]
5252
files: frontend/src/styles/.*(css|scss)$
53+
- repo: https://github.com/koalaman/shellcheck-precommit
54+
rev: v0.7.2
55+
hooks:
56+
- id: shellcheck
57+
args: ["--severity=warning"]

api_app/analyzers_manager/repo_downloader.sh

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,26 @@
77
# Example: you may want to add a new repository. Add the clone here
88
# Example: you may want to remove some of the rules available in the downloaded repositories. Remove them here.
99

10-
1110
# This script can be disabled during development using REPO_DOWNLOADER_ENABLED=true env variable
12-
if [ "$REPO_DOWNLOADER_ENABLED" = "false" ]; then echo "Skipping repo_downloader.sh in DEVELOPMENT mode"; exit 0; fi
11+
if [ "$REPO_DOWNLOADER_ENABLED" = "false" ]; then echo "Skipping repo_downloader.sh in DEVELOPMENT mode"; exit 0; fi
1312

1413
# Download rules for quark-engine analyzer
15-
cd ~
14+
cd ~ || exit
1615
freshquark
1716
# this is the default directory used by Quark-Engine
1817
chown -R www-data:www-data ~/.quark-engine
1918

2019
# Clone dictionaries for dnstwist analyzer
21-
cd /opt/deploy
20+
cd /opt/deploy || exit
2221
svn export https://github.com/elceef/dnstwist/tags/20230402/dictionaries dnstwist-dictionaries
2322

2423
# download exiftool
2524
# https://exiftool.org/install.html#Unix
2625
mkdir exiftool_download
27-
cd exiftool_download
26+
cd exiftool_download || exit
2827
version=$(curl https://exiftool.org/ver.txt)
2928
echo "$version" >> exiftool_version.txt
3029
wget "https://exiftool.org/Image-ExifTool-$version.tar.gz"
3130
gzip -dc "Image-ExifTool-$version.tar.gz" | tar -xf -
32-
cd "Image-ExifTool-$version"
31+
cd "Image-ExifTool-$version" || exit
3332
chown -R www-data:www-data /opt/deploy/exiftool_download
34-
35-

docker/entrypoints/celery_beat.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@ then
1010
echo "Running celery with autoreload"
1111
python3 manage.py celery_reload -c "$ARGUMENTS"
1212
else
13+
# shellcheck disable=SC2086
1314
/usr/local/bin/celery $ARGUMENTS
1415
fi

docker/entrypoints/celery_default.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,6 @@ then
2929
echo "Running celery with autoreload"
3030
python3 manage.py celery_reload -c "$ARGUMENTS"
3131
else
32+
# shellcheck disable=SC2086
3233
/usr/local/bin/celery $ARGUMENTS
3334
fi

docker/entrypoints/celery_ingestor.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ then
1818
echo "Running celery with autoreload"
1919
python3 manage.py celery_reload -c "$ARGUMENTS"
2020
else
21-
/usr/local/bin/celery $ARGUMENTS
21+
/usr/local/bin/celery "$ARGUMENTS"
2222
fi

docker/entrypoints/celery_local.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ then
1717
echo "Running celery with autoreload"
1818
python3 manage.py celery_reload -c "$ARGUMENTS"
1919
else
20-
/usr/local/bin/celery $ARGUMENTS
20+
/usr/local/bin/celery "$ARGUMENTS"
2121
fi

docker/entrypoints/celery_long.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ then
1717
echo "Running celery with autoreload"
1818
python3 manage.py celery_reload -c "$ARGUMENTS"
1919
else
20-
/usr/local/bin/celery $ARGUMENTS
20+
/usr/local/bin/celery "$ARGUMENTS"
2121
fi

docker/entrypoints/flower.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ then
3232
fi
3333

3434
CMD="/usr/local/bin/celery -A intel_owl.celery --broker ${BROKER_URL} flower --broker_api=${BROKER_URL_API} --max_tasks=1000 --max_workers=500"
35-
htpasswd -cb /opt/deploy/shared_htpasswd/.htpasswd ${FLOWER_USER} ${FLOWER_PWD}
35+
htpasswd -cb /opt/deploy/shared_htpasswd/.htpasswd "${FLOWER_USR}" "${FLOWER_PWD}"
3636

3737
if [[ ${DEBUG} == "True" ]] && [[ ${DJANGO_TEST_SERVER} == "True" ]];
3838
then

docker/entrypoints/uwsgi.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ fi
2424
# Collect static files
2525
python manage.py collectstatic --noinput
2626
echo "------------------------------"
27-
echo "DEBUG: " $DEBUG
28-
echo "DJANGO_TEST_SERVER: " $DJANGO_TEST_SERVER
27+
echo "DEBUG: " "$DEBUG"
28+
echo "DJANGO_TEST_SERVER: " "$DJANGO_TEST_SERVER"
2929
echo "------------------------------"
3030
CHANGELOG_NOTIFICATION_COMMAND='python manage.py changelog_notification .github/CHANGELOG.md INTELOWL --number-of-releases 3'
3131
ELASTIC_TEMPLATE_COMMAND='python manage.py elastic_templates'

0 commit comments

Comments
 (0)