diff --git a/python/extractor/cli-integration-test/hidden-files/config.yml b/python/extractor/cli-integration-test/hidden-files/config.yml new file mode 100644 index 00000000000..69d94597d95 --- /dev/null +++ b/python/extractor/cli-integration-test/hidden-files/config.yml @@ -0,0 +1,3 @@ +name: Test Config +paths-ignore: + - "**/.*/**" diff --git a/python/extractor/cli-integration-test/hidden-files/query-default.expected b/python/extractor/cli-integration-test/hidden-files/query-default.expected index cc92af624b3..72d34a1ab0b 100644 --- a/python/extractor/cli-integration-test/hidden-files/query-default.expected +++ b/python/extractor/cli-integration-test/hidden-files/query-default.expected @@ -1,5 +1,6 @@ | name | +-------------------------------+ | .hidden_file.py | +| another_non_hidden.py | | foo.py | | visible_file_in_hidden_dir.py | diff --git a/python/extractor/cli-integration-test/hidden-files/repo_dir/.hidden_dir/internal_non_hidden/another_non_hidden.py b/python/extractor/cli-integration-test/hidden-files/repo_dir/.hidden_dir/internal_non_hidden/another_non_hidden.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/python/extractor/cli-integration-test/hidden-files/test.sh b/python/extractor/cli-integration-test/hidden-files/test.sh index 77cb12664af..45485985adb 100755 --- a/python/extractor/cli-integration-test/hidden-files/test.sh +++ b/python/extractor/cli-integration-test/hidden-files/test.sh @@ -16,8 +16,8 @@ $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: Setting the relevant extractor option to true skips files in hidden directories -$CODEQL database create db-skipped --language python --source-root repo_dir/ --extractor-option python.skip_hidden_directories=true +# 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