-
Notifications
You must be signed in to change notification settings - Fork 291
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
138 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
...cit/aet/artemis/programming/service/localci/scaparser/strategy/sarif/RuffCategorizer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package de.tum.cit.aet.artemis.programming.service.localci.scaparser.strategy.sarif; | ||
|
||
public class RuffCategorizer implements RuleCategorizer { | ||
|
||
@Override | ||
public String categorizeRule(ReportingDescriptor rule) { | ||
return rule.getProperties().getAdditionalProperties().getOrDefault("kind", "Unknown").toString(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
src/main/resources/templates/aeolus/python/default_static.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
export AEOLUS_INITIAL_DIRECTORY=${PWD} | ||
static_code_analysis () { | ||
echo '⚙️ executing static_code_analysis' | ||
ruff check --output-format=sarif --output-file=ruff.sarif --exit-zero --select=ALL "${studentParentWorkingDirectoryName}" | ||
} | ||
|
||
build_and_test_the_code () { | ||
echo '⚙️ executing build_and_test_the_code' | ||
python3 -m compileall . -q || error=true | ||
if [ ! $error ] | ||
then | ||
pytest --junitxml=test-reports/results.xml | ||
fi | ||
} | ||
|
||
main () { | ||
if [[ "${1}" == "aeolus_sourcing" ]]; then | ||
return 0 # just source to use the methods in the subshell, no execution | ||
fi | ||
local _script_name | ||
_script_name=${BASH_SOURCE[0]:-$0} | ||
cd "${AEOLUS_INITIAL_DIRECTORY}" | ||
bash -c "source ${_script_name} aeolus_sourcing; static_code_analysis" | ||
cd "${AEOLUS_INITIAL_DIRECTORY}" | ||
bash -c "source ${_script_name} aeolus_sourcing; build_and_test_the_code" | ||
} | ||
|
||
main "${@}" |
21 changes: 21 additions & 0 deletions
21
src/main/resources/templates/aeolus/python/default_static.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
api: v0.0.1 | ||
actions: | ||
- name: static_code_analysis | ||
script: ruff check --output-format=sarif --output-file=ruff.sarif --exit-zero --select=ALL "${studentParentWorkingDirectoryName}" | ||
results: | ||
- name: ruff | ||
path: ruff.sarif | ||
type: sca | ||
- name: build_and_test_the_code | ||
script: |- | ||
python3 -m compileall . -q || error=true | ||
if [ ! $error ] | ||
then | ||
pytest --junitxml=test-reports/results.xml | ||
fi | ||
runAlways: false | ||
results: | ||
- name: junit_test-reports/*results.xml | ||
path: test-reports/*results.xml | ||
type: junit | ||
before: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters