summaryrefslogtreecommitdiff
path: root/danger/alex/Dangerfile
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2019-01-03 15:46:12 +0100
committerJames Lopez <james@jameslopez.es>2019-02-12 15:44:53 +0100
commit63a1e32dad9ccb59bdb3f65b4619b96317e9cd25 (patch)
tree6c8a48dcf465cf3636b58e94c06792e1f844a642 /danger/alex/Dangerfile
parentd29e81b2aa7fc26736eb09309bbbf2ab5a5d5050 (diff)
downloadgitlab-ce-63a1e32dad9ccb59bdb3f65b4619b96317e9cd25.tar.gz
Add alex as a Danger filefeature/alex-danger-review
Adds a new step in Danger to warn on non-inclusive and profane language. This affects: - Commits - Documentation
Diffstat (limited to 'danger/alex/Dangerfile')
-rw-r--r--danger/alex/Dangerfile25
1 files changed, 25 insertions, 0 deletions
diff --git a/danger/alex/Dangerfile b/danger/alex/Dangerfile
new file mode 100644
index 00000000000..b3174dd2ddb
--- /dev/null
+++ b/danger/alex/Dangerfile
@@ -0,0 +1,25 @@
+require_relative './alex_command'
+
+# frozen_string_literal: true
+
+EXTENSIONS = %w[md txt].freeze
+
+def paths_to_review(files)
+ files.select do |file|
+ EXTENSIONS.any? { |pattern| file.end_with?(pattern) }
+ end
+end
+
+paths = paths_to_review(helper.all_changed_files)
+
+result = AlexCommand.from_paths(paths)
+
+unless result.status.success?
+ markdown(<<~MARKDOWN)
+## Inconsiderate words review
+
+```sh
+#{result.stderr}
+```
+ MARKDOWN
+end