lib/changelog/parsers/keep_a_changelog.rb in danger-changelog-0.7.0 vs lib/changelog/parsers/keep_a_changelog.rb in danger-changelog-0.7.1

- old
+ new

@@ -2,18 +2,18 @@ module Changelog module Parsers class KeepAChangelog < Base def bad_line_message(filename) "One of the lines below found in #{filename} doesn't match the " \ - '[expected format](https://keepachangelog.com).' + '[expected format](https://keepachangelog.com).' end def parse(filename) blocks = parse_into_blocks(File.open(filename).each_line) if contains_header_block?(blocks.first) - blocks = blocks[1..-1] + blocks = blocks[1..] else notify_of_global_failure( 'The changelog is missing the version header for the Keep A ' \ 'Changelog format. See <https://keepachangelog.com> to see ' \ 'the format of the header.' @@ -59,22 +59,22 @@ def contains_header_block?(block) return false unless block return false unless block.first == '# Changelog' - regex = %r{All notable changes to this project will be documented in this file. The format is based on \[Keep a Changelog\]\(https://keepachangelog.com/en/\d\.\d\.\d/\), and this project adheres to \[Semantic Versioning\]\(https:\/\/semver.org\/spec\/v2.0.0.html\).} + regex = %r{All notable changes to this project will be documented in this file. The format is based on \[Keep a Changelog\]\(https://keepachangelog.com/en/\d\.\d\.\d/\), and this project adheres to \[Semantic Versioning\]\(https://semver.org/spec/v2.0.0.html\).} - block_content = block[1..-1].join(' ') + block_content = block[1..].join(' ') regex.match?(block_content) end def markdown_link?(line) /^\[.*\]:/.match?(line) end def markdown_list_item_or_continuation?(line) - /^(?:[\*-]\s| )/.match?(line) + /^(?:[*-]\s| )/.match?(line) end end end end end