[Git][ghc/ghc][wip/andreask/typedUniqFM] Try to include file if lint fails with an exception

Andreas Klebinger gitlab at gitlab.haskell.org
Mon Jun 29 13:46:59 UTC 2020



Andreas Klebinger pushed to branch wip/andreask/typedUniqFM at Glasgow Haskell Compiler / GHC


Commits:
deed0053 by Andreas Klebinger at 2020-06-29T15:46:41+02:00
Try to include file if lint fails with an exception

- - - - -


1 changed file:

- .gitlab/linters/linter.py


Changes:

=====================================
.gitlab/linters/linter.py
=====================================
@@ -70,10 +70,13 @@ class LineLinter(Linter):
     issues found.
     """
     def lint(self, path: Path):
-        if path.is_file():
-            with path.open('r') as f:
-                for line_no, line in enumerate(f):
-                    self.lint_line(path, line_no+1, line)
+        try:
+            if path.is_file():
+                with path.open('r') as f:
+                    for line_no, line in enumerate(f):
+                        self.lint_line(path, line_no+1, line)
+        except e:
+            raise RuntimeError("Failed to lint file: " + path) from e
 
     def lint_line(self, path: Path, line_no: int, line: str):
         raise NotImplementedError



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/deed00530436b00a59db00423438618067f155d9

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/deed00530436b00a59db00423438618067f155d9
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20200629/12f02209/attachment.html>


More information about the ghc-commits mailing list