cli: honor -w/--no-warnings for the file-too-large skip message#2219
Merged
Merged
Conversation
scan_dir() prints "skipping <file> ... because it's larger than N bytes" unconditionally on both the POSIX and Windows paths, ignoring ignore_warnings even though every other warning in this file checks it. Guard both prints the same way the other warnings already are. Fixes VirusTotal#2137
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
plusvic
approved these changes
Jul 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2137.
-w/--no-warningsskips every other warning incli/yara.cbut not the "skipping X because it's larger than N bytes" message fromscan_dir. That one's printed unconditionally on both the POSIX and Windows code paths, so-w -z <size>still spams stderr with a line per oversized file.Wrapped both prints in
if (!ignore_warnings), same flag and same pattern already used for the other warnings in this file (e.g. theCALLBACK_MSG_TOO_SLOW_SCANNING/CALLBACK_MSG_TOO_MANY_MATCHEScases). No behavior change to which files get scanned, just the message.Didn't have a build toolchain handy to test this on, but it's a one-line
else->else if (!ignore_warnings)in each of the twoscan_dirimplementations (Unix and Windows), matching the guard style already used three other times in this same file.