Skip to content

Commit 45488b6

Browse files
committed
feat: remove dc directory
1 parent b160907 commit 45488b6

3 files changed

Lines changed: 10 additions & 15 deletions

File tree

Dockerfile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ RUN apk add --no-cache --virtual .build-deps g++ libffi-dev \
77
&& pip install deepcode \
88
&& apk del .build-deps
99

10-
COPY dc/ /dc/
10+
COPY entrypoint.sh /deepcode/entrypoint.sh
11+
COPY deepcode_to_sarif.py /deepcode/deepcode_to_sarif.py
1112

12-
RUN adduser -u 2004 -D docker
13-
RUN chown -R docker:docker /dc
14-
15-
CMD [ "bash", "/dc/entrypoint.sh" ]
13+
CMD [ "bash", "/deepcode/entrypoint.sh" ]

dc/entrypoint.sh renamed to entrypoint.sh

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22

3-
OUTPUT_FILE="/dc/output.json"
4-
ANALYSIS_DIR="/dc/src"
3+
OUTPUT_FILE="output.json"
4+
ANALYSIS_DIR="/deepcode/src"
55

66
if ! [ -d "$GITHUB_WORKSPACE" ]
77
then
@@ -25,7 +25,7 @@ echo "External environment variables: DEBUG=$DEBUG TIMEOUT=$TIMEOUT" >&3
2525

2626
# SUPPORT FUNCTIONS
2727
function load_src_files {
28-
codacy_files=$(cd $GITHUB_WORKSPACE || exit; find . -type f -exec echo {} \; | cut -c3-)
28+
files=$(cd $GITHUB_WORKSPACE || exit; find . -type f -exec echo {} \; | cut -c3-)
2929
}
3030

3131
function create_symlink {
@@ -60,7 +60,7 @@ rm -rf "$ANALYSIS_DIR"
6060
mkdir -p "$ANALYSIS_DIR"
6161
while read -r file; do
6262
create_symlink "$file"
63-
done <<< "$codacy_files"
63+
done <<< "$files"
6464

6565
# Spawn a child process for the analysis
6666
echo "Spawning analysis child process." >&3
@@ -103,10 +103,6 @@ if [ $analysis_exitcode -eq 0 ]; then
103103
exit 0
104104
fi
105105

106-
107-
# FORMAT OUTPUT
108-
echo "Converting DeepCode output to Codacy format." >&3
109-
110106
declare -A RULEMAP
111107

112108
output=$(cat $OUTPUT_FILE)
@@ -135,8 +131,9 @@ fi
135131

136132
# cat $OUTPUT_FILE
137133

138-
# TODO: make sure the following line does not throw an error
139-
python /dc/deepcode_to_sarif.py $OUTPUT_FILE
134+
# TODO: make sure the following line does not throw an error and
135+
# handle this case properly with proper exit codes and messages
136+
python /deepcode/deepcode_to_sarif.py $OUTPUT_FILE
140137

141138
echo "Success." >&3
142139
exit 0

0 commit comments

Comments
 (0)