Skip to content

The stringcase library is buggy and unmaintained #369

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

Closed
ramnes opened this issue Mar 30, 2021 · 2 comments · Fixed by #375
Closed

The stringcase library is buggy and unmaintained #369

ramnes opened this issue Mar 30, 2021 · 2 comments · Fixed by #375
Labels
🐞bug Something isn't working

Comments

@ramnes
Copy link
Contributor

ramnes commented Mar 30, 2021

Describe the bug
Latest version on PyPI of the stringcase library has pretty nasty bugs. The repository on GitHub has a tiny bit of activity and supposedly fixed one or two already but the owner did not make a release since 2017 anyway.

To Reproduce

>>> stringcase.pascalcase("test-parameter")
'Tesarameter'

Expected behavior

'TestParameter'

Additional context
I just took at look at the alternatives and found these two:

Humps has some traction but also is unmaintained at the moment. My vote would go to caseconverter, whose implementation seems a bit more robust at first glance, or to rewrite what's needed here directly.

@ramnes ramnes added the 🐞bug Something isn't working label Mar 30, 2021
@dbanty
Copy link
Collaborator

dbanty commented Mar 31, 2021

I think we have some weird workarounds in our code to deal with some stringcase inconsistencies 😅so yeah if there's a better lib we can switch to I'm all for it.

ramnes added a commit to ramnes/openapi-python-client that referenced this issue Apr 1, 2021
Let's reimplement what we need here so that we don't depend on stringcase
anymore (see openapi-generators#369 for rationale). I've added a few test cases for stuff I've
seen break along the way.
@forest-benchling
Copy link
Collaborator

cc @dtkav haha we've been bitten by stringcase too. Thanks @ramnes for taking the initiative on fixing this.

@dbanty dbanty linked a pull request Apr 25, 2021 that will close this issue
ramnes added a commit to ramnes/openapi-python-client that referenced this issue Apr 28, 2021
Let's reimplement what we need here so that we don't depend on stringcase
anymore (see openapi-generators#369 for rationale). I've added a few test cases for stuff I've
seen break along the way.
dbanty added a commit that referenced this issue Apr 28, 2021
…ncies. (closes #369) (#375) Thanks @ramnes!

* Don't depend on stringcase (closes #369)

Let's reimplement what we need here so that we don't depend on stringcase
anymore (see #369 for rationale). I've added a few test cases for stuff I've
seen break along the way.

* refactor: Fix unit test to match new behavior, optimize word capitalization.

* test: Regen golden-record

* fix(cases): treat numbers as words when processing cases

Co-authored-by: Dylan Anthony <[email protected]>
Co-authored-by: Dylan Anthony <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants