Expected an indentation at 22 instead of at 21. Invalid
value: @planting.planted_at ? @planting.planted_at.to_fs(:ymd) : '',
- Create a ticketCreate a ticket
- Exclude checks
Expected an indentation at 22 instead of at 21. Open
placeholder: 'optional'
- Create a ticketCreate a ticket
- Exclude checks
Expected an indentation at 22 instead of at 21. Open
class: 'add-datepicker', label: 'When?'
- Create a ticketCreate a ticket
- Exclude checks
Expected an indentation at 22 instead of at 21. Open
class: 'add-datepicker',
- Create a ticketCreate a ticket
- Exclude checks
Expected an indentation at 22 instead of at 21. Invalid
value: @planting.finished_at ? @planting.finished_at.to_fs(:ymd) : '',
- Create a ticketCreate a ticket
- Exclude checks
Expected an indentation at 22 instead of at 21. Open
label: 'Finished date',
- Create a ticketCreate a ticket
- Exclude checks
The = symbol should have one space separating it from code Open
%strong=yield :title
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
HamlLint/SpaceBeforeScript
Separate Ruby script indicators (-
/=
) from their code with a single space.
Bad: no space between =
and some_expression
haml
=some_expression
Good
haml
= some_expression
Good
haml
- some_value = 'Hello World'
Ensuring space after -
/=
enforces a consistency that all HAML tags/script
indicators are separated from their inline content by a space. Since it is
optional to add a space after -
/=
but required when writing %tag
or
similar, the consistency is best enforced via a linter.
Line is too long. [126/120] Open
Tip: Plan our your future plantings by forward dating, and subscribe to your iCalendar feed for reminders to plant
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
HamlLint/LineLength
Option | Description |
---|---|
max |
Maximum number of columns a single line can have. (default 80 ) |
Wrap lines at 80 characters. You can configure this amount via the max
option on the linter, e.g. by adding the following to your .haml-lint.yml
:
linters:
LineLength:
max: 100
Long lines are harder to read and usually indicative of complexity. You can avoid them by splitting long attribute hashes on a comma, for example:
%tag{ attr1: 1,
attr2: 2,
attr3: 3 }
This significantly improves readability.