Closed
Description
Community Note
- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
- Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
- If you are interested in working on this issue or have submitted a pull request, please leave a comment
Description
When scanning deep hierarchies of project files, TruffleHog outputs many warnings about broken symlinks where the target does not exist. They are usually not useful information and only add noise to the output.
2023-03-05T10:56:38+02:00 info-0 trufflehog unable to stat file {"source_type": "SOURCE_TYPE_FILESYSTEM", "source_name": "filesystem", "path": "/usr/src/node-red/node_modules/.bin/prebuild", "error": "stat /usr/src/node-red/node_modules/.bin/prebuild: no such file or directory"}
Problem to be Addressed
The warning about broken symlinks could be optional. The option could just quietly ignore all "no such file or directory" errors from Stat() using something like if errors.Is(err, os.ErrNotExist) { ... }
. If necessary, a more advanced solution could use os.Lstat()
to check if the problematic file really was a symlink.
Description of the Preferred Solution
Add a command line switch to ignore broken symlinks (don't print the warning about each file).