You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Consider that Resource.parent can be None when removing resources from the codebase #84
None has no children_names , it fails. This happens in example if the plugin_ignore of scancode trys to remove some resources from the codebase at: scancode/plugin_ignore.py(121)process_codebase()
How to reproduce:
❯ scancode --processes 10 -l -p -c -i --ignore "*/test/*" --license-score 20 --strip-root --json-pp test.json repos/git/github/systemd/systemd-stable
Setup plugins...
Collect file inventory...
ERROR: failed to run pre-scan plugin: ignore:
Traceback (most recent call last):
File "/home/jloehel/projects/github.com/aboutcode-org/scancode-toolkit/src/scancode/cli.py", line 1119, in run_codebase_plugins
plugin.process_codebase(codebase, **kwargs)
~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
File "/home/jloehel/projects/github.com/aboutcode-org/scancode-toolkit/src/scancode/plugin_ignore.py", line 121, in process_codebase
remove_resource(resource)
~~~~~~~~~~~~~~~^^^^^^^^^^
File "/home/jloehel/projects/github.com/aboutcode-org/scancode-toolkit/.venv/lib64/python3.13/site-packages/commoncode/resource.py", line 911, in remove_resource
parent.children_names.remove(resource.name)
^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'children_names'
...
Activity