Skip to content

fix: Added custom toCamel, toSnake implementation#171

Merged
amanenk merged 13 commits intocloudquery:mainfrom
amanenk:fix_to_snake
Sep 27, 2022
Merged

fix: Added custom toCamel, toSnake implementation#171
amanenk merged 13 commits intocloudquery:mainfrom
amanenk:fix_to_snake

Conversation

@amanenk
Copy link
Copy Markdown
Contributor

@amanenk amanenk commented Sep 22, 2022

Summary

Since there is no way to cover all the acronyms, the functionality of acronyms customization added. Also some popular acronyms are taken from golang linter as default.
closes #159


Use the following steps to ensure your PR is ready to be reviewed

  • Read the contribution guidelines 🧑‍🎓
  • Run go fmt to format your code 🖊
  • Lint your changes via golangci-lint run 🚨 (install golangci-lint here)
  • Update or add tests 🧪
  • Ensure the status checks below are successful ✅

@github-actions github-actions bot added the fix label Sep 22, 2022
@amanenk amanenk requested a review from erezrokah September 23, 2022 09:01
@amanenk amanenk marked this pull request as ready for review September 23, 2022 09:02
@github-actions github-actions bot added fix and removed fix labels Sep 23, 2022
Copy link
Copy Markdown
Contributor

@hermanschaaf hermanschaaf left a comment

Choose a reason for hiding this comment

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

Looks good 👍 I wonder: should this be internal to the sdk? We also use the strcase library in the plugin codegen packages, e.g. here: https://github.com/cloudquery/cloudquery/blob/main/plugins/source/aws/codegen/recipes/base.go#L99 and here: https://github.com/cloudquery/cloudquery/blob/main/plugins/source/aws/codegen/recipes/base.go#L113-L116

So would it maybe be better to recommend using our official implementation from the plugin-sdk, since we've fixed a few of the bugs? In that case, it shouldn't be internal here.

The other thing: maybe we should call this caser or something similar, since it now does more than just snake case 🙂

@amanenk
Copy link
Copy Markdown
Contributor Author

amanenk commented Sep 27, 2022

I have moved the package to a separate repo.

@hermanschaaf
Copy link
Copy Markdown
Contributor

@amanenk Oh, I didn't actually mean it should be in a different repo--let's keep it in plugin-sdk for now to get the benefit of CI and linting etc--I just meant it shouldn't be under the internal path, because then other packages can't import it.

@amanenk
Copy link
Copy Markdown
Contributor Author

amanenk commented Sep 27, 2022

I see. will fix it now

@amanenk amanenk merged commit f28e208 into cloudquery:main Sep 27, 2022
hermanschaaf pushed a commit that referenced this pull request Sep 27, 2022
🤖 I have created a release *beep* *boop*
---


##
[0.9.1](v0.9.0...v0.9.1)
(2022-09-27)


### Bug Fixes

* Added custom toCamel, toSnake implementation
([#171](#171))
([f28e208](f28e208))
* **cli:** Added more informative error when there is no config files
([#179](#179))
([a7ab327](a7ab327))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
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.

Replace strcase.ToSnake with a better alternative

2 participants