summaryrefslogtreecommitdiff
path: root/.arc-linters
diff options
context:
space:
mode:
authorPhil Ruffwind <rf@rufflewind.com>2016-12-22 17:06:51 -0500
committerBen Gamari <ben@smart-cactus.org>2016-12-23 16:44:47 -0500
commit158530a5450b27eb5ae2d75b7895fd1662dde13b (patch)
tree7a0be5291bb05086e6f656f20cdbee23b139a8a8 /.arc-linters
parent8f89e76389569b73ce0d7550302641bbea438dfc (diff)
downloadhaskell-158530a5450b27eb5ae2d75b7895fd1662dde13b.tar.gz
Add caret diagnostics
This is controlled by -f[no-]diagnostics-show-caret. Example of what it looks like: ``` | 42 | x = 1 + () | ^^^^^^ ``` This is appended to each diagnostic message. Test Plan: testsuite/tests/warnings/should_fail/CaretDiagnostics1 testsuite/tests/warnings/should_fail/CaretDiagnostics2 Reviewers: simonpj, austin, bgamari Reviewed By: simonpj, bgamari Subscribers: joehillen, mpickering, Phyx, simonpj, alanz, thomie Differential Revision: https://phabricator.haskell.org/D2718 GHC Trac Issues: #8809
Diffstat (limited to '.arc-linters')
-rwxr-xr-x.arc-linters/check-binaries.py4
-rwxr-xr-x.arc-linters/check-cpp.py4
2 files changed, 4 insertions, 4 deletions
diff --git a/.arc-linters/check-binaries.py b/.arc-linters/check-binaries.py
index 9125985489..85227eaa4e 100755
--- a/.arc-linters/check-binaries.py
+++ b/.arc-linters/check-binaries.py
@@ -9,8 +9,8 @@ import json
path = sys.argv[1]
warnings = []
if os.path.isfile(path):
- with open(path) as f:
- if '\0' in f.read(8000):
+ with open(path, 'rb') as f:
+ if b'\0' in f.read(8000):
warning = {
'severity': 'warning',
'message': 'This file appears to be a binary file; does it really belong in the repository?'
diff --git a/.arc-linters/check-cpp.py b/.arc-linters/check-cpp.py
index 52961e6edd..f9d0552b00 100755
--- a/.arc-linters/check-cpp.py
+++ b/.arc-linters/check-cpp.py
@@ -25,9 +25,9 @@ logger.debug(sys.argv)
path = sys.argv[1]
warnings = []
-r = re.compile(r'ASSERT\s+\(')
+r = re.compile(rb'ASSERT\s+\(')
if os.path.isfile(path):
- with open(path) as f:
+ with open(path, 'rb') as f:
for lineno, line in enumerate(f):
if r.search(line):
warning = {