mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-06 23:48:50 +00:00
added one more rule to the coding standards
This commit is contained in:
@@ -23,9 +23,10 @@ standards:
|
||||
{%- if foo -%}{%- endif -%}
|
||||
|
||||
* Put one (and only one) space before and after the following operators:
|
||||
comparison operators (``==``, ``!=``, ``<``, ``>``, ``>=``, and ``<=``),
|
||||
math operators (``+``, ``-``, ``/``, ``*``, ``%``, ``//``, ``**``), ``~``,
|
||||
``is``, ``in``, ``not``, ``and``, ``or``, and the ternary operator (``?:``):
|
||||
comparison operators (``==``, ``!=``, ``<``, ``>``, ``>=``, ``<=``), math
|
||||
operators (``+``, ``-``, ``/``, ``*``, ``%``, ``//``, ``**``), logic
|
||||
operators (``not``, ``and``, ``or``), ``~``, ``is``, ``in``, and the ternary
|
||||
operator (``?:``):
|
||||
|
||||
.. code-block:: jinja
|
||||
|
||||
@@ -41,6 +42,13 @@ standards:
|
||||
{{ [1, 2, 3] }}
|
||||
{{ {'foo': 'bar'} }}
|
||||
|
||||
* Do not put any spaces after an opening parenthesis and before a closing
|
||||
parenthesis in expressions:
|
||||
|
||||
.. code-block:: jinja
|
||||
|
||||
{{ 1 + (2 * 3) }}
|
||||
|
||||
* Do not put any spaces before and after string delimiters:
|
||||
|
||||
.. code-block:: jinja
|
||||
|
||||
Reference in New Issue
Block a user