method

validate_leading_whitespace

Importance_0
v8.1.1 - Show latest stable - 0 notes - Class: Entry
validate_leading_whitespace() private

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# 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
Register or log in to add new notes.