From 3e16bd260f1fc2b7d550a93e29217f7cc6fdbf3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milan=20V=C3=ADt?= Date: Wed, 21 Feb 2018 00:02:55 +0100 Subject: [PATCH] Added more Danger checks --- Dangerfile | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Dangerfile b/Dangerfile index f28a738..78cd593 100644 --- a/Dangerfile +++ b/Dangerfile @@ -10,6 +10,17 @@ warn 'Too many changes (when adding, please keep it to one project per Pull Requ # Warn if pull request is not updated warn 'Please update the Pull Request title to contain the library name' if github.pr_title.include? 'Update README.md' +incorrect_lines = [] + +File.open('README.md').each_line do |line| + next if line !~ /- (?:(!\[v\d\]\(img\/vapor\-\d.png\) ))*\[.+\]\(https?.+\).+/ + next if line =~ /\) –/ && line =~ /\.$/ + + incorrect_lines.push(line) +end + +fail 'Please make sure your submission uses correctly sized dash and ends with a full stop' if incorrect_lines.count > 0 + # Check links require 'json'