lib/harri/regexes.rb in harri-0.1.2 vs lib/harri/regexes.rb in harri-0.1.3
- old
+ new
@@ -1,35 +1,35 @@
module Harri
module Regexes
# Intended to capture the first line of an error within GHC's output.
START_ERROR_REGEX = %r{
- (.*\.hs) # filename
- : # literal colon
- \d+ # line number
- : # literal colon
- \d+ # column number
- : # literal colon
- \s # space
+ (.*\.hs) # filename
+ : # literal colon
+ \d+ # line number
+ : # literal colon
+ (\d+)(?:-(\d+))? # column number
+ : # literal colon
+ \s # space
error:.* # literal "error:" with possible marker
}x
# Intended to capture an unused import error within GHC's output.
UNUSED_IMPORT_ERROR_REGEX = %r{
.*\.hs # filename
: # literal colon
\d+ # line number
: # literal colon
- \d+ # column number
+ (\d+)(?:-(\d+))? # column number
: # literal colon
\s # space
error: # literal "error:"
\s # space
\[-Wunused-imports,\s-?Werror=unused-imports\] # literal "[-Wunused-imports, -Werror=unused-imports]"
# with an optional dash attached to Werror
}x
# Intended to capture the scenario when an entire module is redundant.
- ENTIRE_MODULE_REDUNDANT_REGEX = /The(?: qualified)? import of ‘(.+)’ is redundant except.*/
+ ENTIRE_MODULE_REDUNDANT_REGEX =/The(?: qualified)? import of ‘([^’]+)’ is redundant(?!.*from module)/
# Intended to capture the scenario when specific imports within a module are redundant.
REDUNDANT_IMPORTS_WITHIN_MODULE_REGEX = /The import of ‘(.+)’ from module ‘(.+)’ is redundant.*/
# Intended to capture a full import declaration within a Haskell module.