Skip to content

Comments

Support excluding files or directories from analyze_project.#124

Merged
martindemello merged 2 commits intomasterfrom
exclude
Aug 10, 2018
Merged

Support excluding files or directories from analyze_project.#124
martindemello merged 2 commits intomasterfrom
exclude

Conversation

@rchen152
Copy link
Contributor

  • 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.

This PR will have to be imported into Google and then re-exported.

* 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.

if not args.filenames:
if not args.inputs:
parser.parser.print_usage()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

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'.
@martindemello martindemello merged commit 33703b9 into master Aug 10, 2018
@rchen152
Copy link
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.

@martindemello
Copy link
Contributor

ah, i missed that comment in the initial description, sorry.

rchen152 added a commit that referenced this pull request Aug 10, 2018
PiperOrigin-RevId: 208175558
@rchen152 rchen152 deleted the exclude branch August 10, 2018 08:24
rchen152 added a commit that referenced this pull request Aug 10, 2018
PiperOrigin-RevId: 208175558
martindemello added a commit that referenced this pull request Aug 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants