Skip to content
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

add torchfix --version #14

Merged
merged 2 commits into from
Jan 27, 2024

Conversation

seemethere
Copy link
Contributor

Also changes the default command to not require an argument and to default to your current working directory

Fixes #13

Also changes the default command to not require an argument and to
default to your current working directory

Signed-off-by: Eli Uriegas <[email protected]>
@seemethere seemethere requested a review from kit1980 January 27, 2024 00:10
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jan 27, 2024
@@ -14,7 +14,8 @@ def main() -> None:

parser.add_argument(
"path",
nargs="+",
nargs="*",
Copy link
Contributor

Choose a reason for hiding this comment

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

The current behavior is intentional to mimic ruff's API.

Copy link
Contributor Author

@seemethere seemethere Jan 27, 2024

Choose a reason for hiding this comment

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

torchfix --version won't work otherwise since the invocation will have to look like torchfix --version .

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For context this is what this looks like if you don't change that:

❯ torchfix --version
usage: torchfix [-h] [--fix] [-j JOBS] [--select {ALL}] [--version] [--show-stderr] path [path ...]
torchfix: error: the following arguments are required: path

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe it's a bigger change, but torchfix --version should work, and just torchfix should print help.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think nargs is fine, but without default?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay changed!

@kit1980 kit1980 merged commit a776f3e into pytorch-labs:main Jan 27, 2024
2 checks passed
@seemethere seemethere deleted the seemethere/add_version_flag branch January 27, 2024 00:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add torchfix --version to print the version
3 participants