From ef26c1b7e099169eb72ba76caf50a52250797e10 Mon Sep 17 00:00:00 2001 From: "Francis T. O'Donovan" Date: Thu, 30 Nov 2017 21:24:02 -0500 Subject: [PATCH] Fix mdl MESSAGE_REGEX While reviewing the `MESSAGE_REGEX` for `mdl`, I noticed that it is incomplete, and is missing the message output of `mdl`. This updates the regular expression to specifically match this output. --- config/default.yml | 2 +- lib/overcommit/hook/pre_commit/mdl.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/default.yml b/config/default.yml index bac9a8a5..bc8f6840 100644 --- a/config/default.yml +++ b/config/default.yml @@ -415,7 +415,7 @@ PreCommit: Mdl: enabled: false - description: 'Analyze with mdl' + description: 'Analyze markdown files with mdl' required_executable: 'mdl' install_command: 'gem install mdl' include: '**/*.md' diff --git a/lib/overcommit/hook/pre_commit/mdl.rb b/lib/overcommit/hook/pre_commit/mdl.rb index 444e8652..305d0c20 100644 --- a/lib/overcommit/hook/pre_commit/mdl.rb +++ b/lib/overcommit/hook/pre_commit/mdl.rb @@ -3,7 +3,7 @@ module Overcommit::Hook::PreCommit # # @see https://github.com/mivok/markdownlint class Mdl < Base - MESSAGE_REGEX = /^(?(?:\w:)?[^:]+):(?\d+)/ + MESSAGE_REGEX = /^(?(?:\w:)?[^:]+):(?\d+):\s(?.+)/ def run result = execute(command, args: applicable_files)