mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
Python: Update test
The second test case now sets the `paths-ignore` setting in the config file in order to skip files in hidden directories.
This commit is contained in:
@@ -0,0 +1,3 @@
|
|||||||
|
name: Test Config
|
||||||
|
paths-ignore:
|
||||||
|
- "**/.*/**"
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
| name |
|
| name |
|
||||||
+-------------------------------+
|
+-------------------------------+
|
||||||
| .hidden_file.py |
|
| .hidden_file.py |
|
||||||
|
| another_non_hidden.py |
|
||||||
| foo.py |
|
| foo.py |
|
||||||
| visible_file_in_hidden_dir.py |
|
| visible_file_in_hidden_dir.py |
|
||||||
|
|||||||
@@ -16,8 +16,8 @@ $CODEQL database create db --language python --source-root repo_dir/
|
|||||||
$CODEQL query run --database db query.ql > query-default.actual
|
$CODEQL query run --database db query.ql > query-default.actual
|
||||||
diff query-default.expected query-default.actual
|
diff query-default.expected query-default.actual
|
||||||
|
|
||||||
# Test 2: Setting the relevant extractor option to true skips files in hidden directories
|
# 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/ --extractor-option python.skip_hidden_directories=true
|
$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
|
$CODEQL query run --database db-skipped query.ql > query-skipped.actual
|
||||||
diff query-skipped.expected query-skipped.actual
|
diff query-skipped.expected query-skipped.actual
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user