-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Approved and mergeable PRs 1 and 24 with conflicts already resolved #32
Closed
Conversation
This file contains 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
Memory can be a problem over a large number of files. Added file-size and max-file-size to check only files of a certain size min, max or range. It is ultimately more important to check all identical files in a directory than check all files and run short on memory. It also provides a quick way to save space by hardlinking only the larger files.
A more specific name and consistent w/ options.max_file_size
Make verbosity checks consistently use "greater than", rather than "greater than or equal".
Since it's a counter, rather than a boolean, 'verbosity' is a more appropriate word.
Even though verbosity resets the value to zero on the first '-v' encountered, if no '-v' the variable is initialized to None (at least in Python 3)
There is a rare corner case when transitioning from old verbose option arguments (-v num) to new (-v -v ...), that the OptionParser cannot catch, when the given 'num' matches an existent directory name. Add a safeguard to prevent scanning 'num' directories inadvertently when old-style verbose arguments are still being used. This *could* block intentional cases where someone wants to legitimately scan a directory named as a number. This seems a rare case, though, and can be worked around by not specifying the directory name directly after a '-v' argument (or not using '-v'). An error message is printed to indicate the ambiguous argument, and the code can be disabled by changing the default global boolean. Eventually, this safeguard could be removed, when it's safe to assume that users have transitioned to the new style verbosity arguments.
Separate from the regular file check, allowing further tests without a long boolean chain, and use the stat_info attributes for consistency with other parts of the code.
Simple tests to specify file sizes out of range of the test data, and ensure that no changes were made (similar to a dry-run).
Addresses issue GH akaihola#1 and incorporates @wolfospealain verbosity changes. Changes internal variable name to the more appropriate 'verbosity'. Adds a safeguard against certain rare cases where an old-style verbose numeric argument might be misinterpreted as an existent directory. Should help better justify the transition to the new style.
Adds the file size options implemented by @wolfospealain, with argument range checking and test cases.
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.
As my individual PRs are approved (but not yet merged), I'll produce an updated PR like this that resolves the conflicts amongst the individual PRs (due to them all being based on current master rather than ordered upon each other). This should mean that accepting multiple approved PRs is as simple as merging a single non-conflicting PR. This allows each PR to be individually reviewed, without having upstream to do the integration work. Test cases will verify the integrity of the integrated PRs.
This PR consists of the verbosity option update (PR #1) and the file size options (PR #24), approved by jamescassell.