method
validate_leading_whitespace
v7.1.3.4 -
Show latest stable
- Class:
RailInspector::Changelog::Entry
validate_leading_whitespace()private
No documentation available.
# File tools/rail_inspector/lib/rail_inspector/changelog.rb, line 54
def validate_leading_whitespace
unless header.match?(/\* {3}\S/)
add_offense(
header,
line_in_file(0),
1..4,
"CHANGELOG header must start with '*' and 3 spaces"
)
end
lines.each_with_index do |line, i|
next if i == 0
next if line.strip.empty?
next if line.start_with?(" " * 4)
add_offense(
line,
line_in_file(i),
1..4,
"CHANGELOG line must be indented 4 spaces"
)
end
end