aboutcode-org / aboutcode-org/scancode-toolkit

`--ignore` does not appear to work for directories

オープン
#4,212 コメント 2 件 リアクション 1 件 担当者 0 名 GitHub で見る
bug
主要言語
Python
スター
2.6k
フォーク
791
平均マージ
1日 12時間
マージ済み PR(30日)
5

説明

Directories specified in the `--ignore` list still appear in the result list.

```none
$ scancode --version
ScanCode version: 32.3.3
ScanCode Output Format version: 4.0.0
SPDX License list version: 3.26
```

I tried the following basic invocations...

```sh
scancode --ignore build/* --verbose --json-pp - .
```

The way it evaluated the glob without parenthesis in the `options` was interesting...

```none
"options": {
"input": [
"build/CMakeFiles",
"build/CTestTestfile.cmake",
"build/DartConfiguration.tcl",
"build/Makefile",
"build/Testing",
"build/_deps",
"build/cmake_install.cmake",
"build/compile_commands.json",
"build/generated-includes",
"build/libnote_c.a",
"build/libnote_c.so",
"build/test",
"."
],
"--ignore": [
"build/CMakeCache.txt"
],
"--json-pp": "-",
"--verbose": true
},
```

I tried putting parenthesis in around the ignore, then it captures the `ignore` literally, and gets the `input` correct (but that results in no filtering)...

```sh
scancode --ignore "build/*" --verbose --json-pp - .
```

but I still see these in my output...

```none
$ scancode --ignore "note-c/build/*" --verbose --json-pp - .
Setup plugin: pre_scan:ignore...
Setup plugin: output:json-pp...
Collect file inventory...
Run pre-scans...
Run pre-scan: ignore...
Save scan results...
Save scan results as: json-pp...
{
"headers": [
{
"tool_name": "scancode-toolkit",
"tool_version": "32.3.3",
"options": {
"input": [
"."
],
"--ignore": [
"build/*"
],
"--json-pp": "-",
"--verbose": true
},
"notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.",
"start_timestamp": "2025-03-25T132932.971187",
"end_timestamp": "2025-03-25T132933.313648",
"output_format_version": "4.0.0",
"duration": 0.3424708843231201,
"message": null,
"errors": [],
"warnings": [],
"extra_data": {
"system_environment": {
"operating_system": "linux",
"cpu_architecture": "64",
"platform": "Linux-6.8.0-55-generic-x86_64-with-glibc2.36",
"platform_version": "#57-Ubuntu SMP PREEMPT_DYNAMIC Wed Feb 12 23:42:21 UTC 2025",
"python_version": "3.11.2 (main, Nov 30 2024, 21:22:50) [GCC 12.2.0]"
},
"spdx_license_list_version": "3.26",
"files_count": 202
}
}
],
"files": [
{
"path": "note-c",
"type": "directory",
"scan_errors": []
},
...
{
"path": "note-c/build",
"type": "directory",
"scan_errors": []
},
{
"path": "note-c/build/_deps",
"type": "directory",
"scan_errors": []
},
{
"path": "note-c/build/_deps/catch2-build",
"type": "directory",
"scan_errors": []
},
{
"path": "note-c/build/_deps/catch2-build/CMakeFiles",
"type": "directory",
"scan_errors": []
},
{
"path": "note-c/build/_deps/catch2-build/generated-includes",
"type": "directory",
"scan_errors": []
},
...
```
_truncated for readability_

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。