Support excluding files or directories from analyze_project.#124
Merged
martindemello merged 2 commits intomasterfrom Aug 10, 2018
Merged
Support excluding files or directories from analyze_project.#124martindemello merged 2 commits intomasterfrom
martindemello merged 2 commits intomasterfrom
Conversation
* Supports an --exclude flag to make it easy to exclude parts of a directory that are not pytype-safe (e.g., `pytype subpackage --exclude subpackage/*_test.py`) * Renames the filenames arg to inputs in preparation for adding it to the configuration file, since `filenames` is a bit of a misnomer when we allow directories as well.
pytype/tools/analyze_project/main.py
Outdated
|
|
||
| if not args.filenames: | ||
| if not args.inputs: | ||
| parser.parser.print_usage() |
Contributor
There was a problem hiding this comment.
while you're at it, add a print statement here saying "No input files" - just printing out the usage can be unhelpful, especially if we add inputs to the config file.
Uses the parser.error() method to print both a usage message and an error. Since pytype-single says 'need a filename', I went with 'need an input'.
Contributor
Author
|
This PR changed files that are tracked internally, so it should've gone through the Copybara PR workflow rather than being merged directly. (I noted that in the initial description.) I think to fix things now I can just make the same change internally and Copybara will figure everything out; let me try. |
Contributor
|
ah, i missed that comment in the initial description, sorry. |
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.
a directory that are not pytype-safe (e.g.,
pytype subpackage --exclude subpackage/*_test.py)it to the configuration file, since
filenamesis a bit of amisnomer when we allow directories as well.
This PR will have to be imported into Google and then re-exported.