Skip to content
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

Update coding standards #4488

Merged
merged 1 commit into from
Nov 30, 2024
Merged

Update coding standards #4488

merged 1 commit into from
Nov 30, 2024

Conversation

VincentLanglet
Copy link
Contributor

No description provided.

doc/coding_standards.rst Show resolved Hide resolved

* Put exactly one space after the ``:`` sign in macro argument declarations:
* Put exactly one space after the ``:`` sign when using named arguments:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure it's worth mentioning a standard for named argument with = since

Use : instead of = to separate argument names and values:

{{ data|convert_encoding(from: 'iso-2022-jp', to: 'UTF-8') }}

doc/coding_standards.rst Show resolved Hide resolved

.. code-block:: twig

{% macro html_input(class: "input") %}
{% html_input(class: "input") %}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
{% html_input(class: "input") %}
{{ html_input(class: "input") }}

?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed, updated

@fabpot
Copy link
Contributor

fabpot commented Nov 30, 2024

Thank you @VincentLanglet.

@fabpot fabpot merged commit c5ebc12 into twigphp:3.x Nov 30, 2024
1 check was pending
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants