-
-
Notifications
You must be signed in to change notification settings - Fork 451
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
feat: support for titles in examples #775
feat: support for titles in examples #775
Conversation
It will allow creating an example but overriding the default name with a custom title that follows the same rules that a name, i.e. alphabetical characters, only. The only difference is that it allows uppercase chars that will be used when certain initials are needed in uppercase: i.e. mongodb and MongoDB (before this changes it was Mongodb). This title will be used here: - the CI descriptor, as its name - the H1 heading in the docs page for the example - the struct for the example, which is now exampleDBContainer - the setupExample function name, which is now setupExampleDB
✅ Deploy Preview for testcontainers-go ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
|
||
### What is this tool not doing? | ||
|
||
- If the example name does not contain alphabeticall characters, it will exit the generation. | ||
- If the example name does not contain alphabetical characters, it will exit the generation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found a typo here
"ToLower": func() string { return example.Lower() }, | ||
"Title": func() string { return example.Title() }, | ||
"ToLowerTitle": func() string { return example.LowerTitle() }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The functions do not receive a parameter, instead reading the example value
Co-authored-by: Kevin Wittek <kiview@users.noreply.github.com>
* main: chore: update Docker labels for containers (testcontainers#813) fix: nil pointer dereference in HealthStrategy (testcontainers#802) fix: Synchronise writes to containers map (testcontainers#812) chore(deps): bump google.golang.org/api from 0.108.0 to 0.109.0 in /examples (testcontainers#810) chore(deps): bump cloud.google.com/go/spanner in /examples/spanner (testcontainers#806) chore: restructure Docker helper methods (testcontainers#799) Verify Reaper state to create new or return existing instance (testcontainers#782) docs: add intel as user (testcontainers#798) chore: bump containerd in examples (testcontainers#797) chore(deps): bump github.com/containerd/containerd from 1.6.15 to 1.6.16 (testcontainers#793) chore: extract docker host calculation to an internal package (testcontainers#796) chore: run "go mod tidy" automatically when creating examples (testcontainers#794) chore: build images with backoff retries (testcontainers#792) fix: use right import package for compose in docs (testcontainers#791) chore(deps): bump google.golang.org/grpc from 1.52.1 to 1.52.3 in /examples (testcontainers#790) Add devcontainer file (testcontainers#765) chore: check dependabot dependencies weekly (testcontainers#789) chore(deps): bump google.golang.org/grpc from 1.52.0 to 1.52.1 in /examples (testcontainers#783) chore: support for titles in examples (testcontainers#775)
What does this PR do?
This PR is adding a flag to the examples generator so that it's possible to define a camelcase version of the name to be used when initials are present.
It will allow creating an example but overriding the default name with a custom title that follows the same rules that a name, i.e. alphabetical
characters, only. The only difference is that it allows uppercase chars that will be used when certain initials are needed in uppercase: i.e.
mongodb and MongoDB (before this changes it was Mongodb).
This title will be used here:
Why is it important?
As detected here a technology with initials generated examples not 100% accurate,
forcing users of the generator to add a second commit polishing certain names.
This PR simplifies the creation of those examples including initials (MongoDB, QuestDB...).
Related issues
How to test this PR