-
Notifications
You must be signed in to change notification settings - Fork 2k
Expand file tree
/
Copy pathtest.sh
More file actions
executable file
·24 lines (16 loc) · 865 Bytes
/
test.sh
File metadata and controls
executable file
·24 lines (16 loc) · 865 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash
set -Eeuo pipefail # see https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/
set -x
CODEQL=${CODEQL:-codeql}
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
cd "$SCRIPTDIR"
rm -rf db db-skipped
# Test 1: Default behavior should be to extract files in hidden directories
$CODEQL database create db --language python --source-root repo_dir/
$CODEQL query run --database db query.ql > query-default.actual
diff query-default.expected query-default.actual
# Test 2: The default behavior can be overridden by setting `paths-ignore` in the config file
$CODEQL database create db-skipped --language python --source-root repo_dir/ --codescanning-config=config.yml
$CODEQL query run --database db-skipped query.ql > query-skipped.actual
diff query-skipped.expected query-skipped.actual
rm -rf db db-skipped