Skip to content

Fix --fixed-length Flag Doesn't Work Alone #79

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

Merged
merged 4 commits into from
Sep 29, 2024

Conversation

poita66
Copy link
Contributor

@poita66 poita66 commented Sep 29, 2024

Fixes #78

Using the --fixed-length flag currently yields the following error:

Usage: python -m labelle.cli.cli [OPTIONS] [TEXT]... COMMAND [ARGS]...
Try 'python -m labelle.cli.cli --help' for help.
╭─ Error ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ Invalid value: Cannot specify min/max and fixed length at the same time                                                                                                                                      │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

This PR allows the --min-length flag to be 0 or None

@poita66 poita66 changed the title Fix --fixed-length Flag Doesn't Work Alone #78 Fix --fixed-length Flag Doesn't Work Alone Sep 29, 2024
@maresb
Copy link
Contributor

maresb commented Sep 29, 2024

Thanks for catching this! Can't we get rid of the min_length == 0 check?

@poita66
Copy link
Contributor Author

poita66 commented Sep 29, 2024

That's what I originally did, but thought that we should retain the existing ability to provide both --min-length and --fixed-length in case anyone was already using them together. This way it's not a breaking change.

@maresb
Copy link
Contributor

maresb commented Sep 29, 2024

Ah ya, I see your point. But in this case I think it was a pure bug. Semantically it doesn't make sense to have --min-length=0 and --fixed-length=x. I'd rather just fix it and consider it as a "bugfix" rather than a "breaking change". Given the error message I think it should be straightforward for anyone who used the --min-length=0 to figure out, but honestly you're probably the first (or at worst second) person to hit this.

@poita66
Copy link
Contributor Author

poita66 commented Sep 29, 2024

Yeah, fair. I'll update the PR

@poita66
Copy link
Contributor Author

poita66 commented Sep 29, 2024

Sorry for the mess of commits. I did them on my phone, which was a mistake. I'll squash them on my laptop in the morning.

@maresb
Copy link
Contributor

maresb commented Sep 29, 2024

No worries and no rush! Thanks so much for the contribution!

@maresb
Copy link
Contributor

maresb commented Sep 29, 2024

This looks good to me, so I'm just going to squash-merge it. Thanks!!!

@maresb maresb merged commit 5f662c0 into labelle-org:main Sep 29, 2024
6 checks passed
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.

--fixed-length Flag Doesn't Work Alone
2 participants