summaryrefslogtreecommitdiff
path: root/.gitlab/linters/check-makefiles.py
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2018-12-13 13:53:27 -0500
committerBen Gamari <ben@smart-cactus.org>2018-12-13 21:59:20 -0500
commite9f68a1529687b11e22cf2b28e119b043dded6a6 (patch)
tree64199b60c6e966bd1bd1ba8b50f8cb35ba51bff5 /.gitlab/linters/check-makefiles.py
parent9b8713e8bf905c17251a0fad22eee690c4e50f0c (diff)
downloadhaskell-e9f68a1529687b11e22cf2b28e119b043dded6a6.tar.gz
gitlab-ci: Add linters
These are taken from our previous arcanist linters as well as the gitolite hooks but with some heavy refactoring.
Diffstat (limited to '.gitlab/linters/check-makefiles.py')
-rwxr-xr-x.gitlab/linters/check-makefiles.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/.gitlab/linters/check-makefiles.py b/.gitlab/linters/check-makefiles.py
new file mode 100755
index 0000000000..c97838beb5
--- /dev/null
+++ b/.gitlab/linters/check-makefiles.py
@@ -0,0 +1,19 @@
+#!/usr/bin/env python3
+
+"""
+Warn for use of `--interactive` inside Makefiles (#11468).
+
+Encourage the use of `$(TEST_HC_OPTS_INTERACTIVE)` instead of
+`$(TEST_HC_OPTS) --interactive -ignore-dot-ghci -v0`. It's too easy to
+forget one of those flags when adding a new test.
+"""
+
+from linter import run_linters, RegexpLinter
+
+linters = [
+ RegexpLinter(r'--interactive',
+ message = "Warning: Use `$(TEST_HC_OPTS_INTERACTIVE)` instead of `--interactive -ignore-dot-ghci -v0`.")
+]
+
+if __name__ == '__main__':
+ run_linters(linters) #$, subdir='testsuite')