Skip to content

Commit 5c8f21a

Browse files
committed
Update Dangerfile to ensure that .gitignore is included in new exercises
1 parent 6b27c27 commit 5c8f21a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Dangerfile

+12
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,18 @@ warn("Big PR") if git.lines_of_code > 500
2020
#ENSURE THERE IS A SUMMARY FOR A PR
2121
warn("Please provide a summary in the Pull Request description. See more info <a href=\"http\://tinyletter.com/exercism/letters/exercism-pull-requests\">here.</a>") if github.pr_body.length < 5
2222

23+
# Ensure that .gitignore is included in new exercises
24+
(git.modified_files + git.added_files)
25+
.map { |path|
26+
match = %r{^(?<dir>exercises/[^/]+).*$}i.match(path) || {}
27+
match[:dir]
28+
}
29+
.uniq
30+
.reject(&:nil?)
31+
.each { |dir|
32+
warn "Missing `#{dir}/.gitignore`" unless File.exists? "#{dir}/.gitignore"
33+
}
34+
2335
# LINT Comments in for each Line
2436
jsonpath = "lintreport.json"
2537
contents = File.read jsonpath

0 commit comments

Comments
 (0)