These are the YAML language-specific coding styles. Anything mentions here overrides/adds to the "In General" guides.
The extension is .yml
.
space
as tab instead of \t
.NOTE
Maintain tab alignment for consistency. That’s how YAML works.
Follow source code. Otherwise ,use double quote ("
).
snake_case
convention._
instead.:
).:
).Example:
this_is_a_very_long_string_label: "string"
integer: 5
float: 10.0
boolean: true
Keep it on its own line. You don’t need an inline comment. The label should be self-explanatory.
Example:
# Server launch date
date: "2001-12-14T21:59:43.10-05:00"
# NOT
date: "2001-12-14T21:59:43.10-05:00" # This is the server launch date
tabulators
for consistency and readability.Example:
symfony-1.0:
- PHP: 5.0
- Propel: 1.2
- python:
- 2.7: 5.2
- 3.3: 4.4
symfony-1.2:
- PHP: 5.2
- Propel: 1.3
<<:
to include them.*
to call your alias group.Example:
common: &default
adapter: postgresql
version: 1.0
development:
<<: *default
database: dev_development
test:
<<: *default
database: test_test
production:
<<: *default
database: test_production
version: 0.5
That's all for YAML coding style.