Class: Yamlint::Rules::Colons

Inherits:
LineRule show all
Defined in:
lib/yamlint/rules/colons.rb

Instance Attribute Summary

Attributes inherited from Base

#config, #level

Instance Method Summary collapse

Methods inherited from LineRule

#check

Methods inherited from Base

#check, defaults, desc, inherited, #initialize, rule_id

Constructor Details

This class inherits a constructor from Yamlint::Rules::Base

Instance Method Details

#check_line(line, line_number, _context) ⇒ Object



14
15
16
17
18
19
20
21
22
# File 'lib/yamlint/rules/colons.rb', line 14

def check_line(line, line_number, _context)
  return if line.strip.empty?
  return if line.strip.start_with?('#')

  problems = []
  problems.concat(check_spaces_before_colon(line, line_number))
  problems.concat(check_spaces_after_colon(line, line_number))
  problems
end

#fixable?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/yamlint/rules/colons.rb', line 24

def fixable?
  true
end