-
Notifications
You must be signed in to change notification settings - Fork 27
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
Custom Capitalizations #415
Comments
Ah, thanks. I missed that. I'll give it a try. |
It looks like that is already being used: But it is still generating invalid names. For example:
|
That’s strange. The latest links you added to your last comment aren’t working for me. Could you point me to the file and the line where you observed the issue for AWS? I’d like to determine if it’s a flaw in the acronym filter or a usage problem. |
@lquerel thanks for the response. Those files are from this PR: open-telemetry/opentelemetry-go#5793 I'm working in that branch and able to reproduce the results generated there. I have updated to use v0.10.0 as well and still not able to remedy the naming. |
FWIW, I have also tried moving the
Still no change. |
Removing the
Which seems to show that the Is there a way to have these work together? |
Could you try the following macro
Applying the |
|
Okay, I see. The |
I'm not proud of this jinja, but I think it works - could you please try it @MrAlias ? {%- macro title_case2(text) -%}
{%- for i in range(0, text | length) -%}
{%- if i == 0 or text[i-1] in ['.', '_'] -%}
{{ text[i] | upper }}
{%- elif not text[i] in ['.', '_'] -%}
{{ text[i] }}
{%- endif -%}
{% endfor %}
{% endmacro %}
{{ title_case2(attribute.name | acronym)}} For |
The Go team currently uses the following capitalization for known acronyms and initialisms:
The current build tooling ensures these capitalizations are used in any naming generated. How can we keep this behavior when using weaver?
The text was updated successfully, but these errors were encountered: