Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately this breaks the
error_warnings
handling below, IIUCMaybe something like
(?:\[GHC-.*\] )?\[(-W.+)\]
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should only affect warning handling. Could you provide a simple example of a code which it breaks?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay sorry i misunderstood, this only matches warnings printed in a single line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but newer GHC versions emit multi-line warnings which in version
0.2.3
are captured assingle_line_warning
(cutting the rest of the warning off, see #98 for example).Example of a warning which would be captured by the previous version of
single_line_warning
:With this change it is correctly handled as a multi-line warning.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My concern is mainly that these warnings (in the
error_warnings
list below) should be shown as errors:It would be fine as long as none of these could be emitted in a single line in GHC 9.6+. However if any of these could then the regex would match the
[GHC-*]
instead of the[-W*]
part, and it would no longer match the list.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok i think mine was not rebuilt completely, i can confirm the fix does work for me. i'm looking into some minor issues, as the typed holes and deferred type errors should be severity error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one issue here is that if i enable
-fdefer-typed-holes
(as is by default), the behavior should be upgrading a hole to a error severity in our diagnosis. this requires us to actually match for the\[(-W.+)\]
part: (two lines below)warning: /^warning:(?: \[GHC-.*\])? \[(-W.+)\]$/
this work as intended on my setup.
for the single line warning we do rely on the group (
error_warnings.indexOf(res_sl_warning[1]) >= 0 ?
). however i could not really get any single line warning in the first place, perhaps we need older ghc? or do you have some examples for a single line warning that does hit this regex?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally I cannot recall seeing single-line warning from GHC myself. Maybe the author of this line can provide an example of the code which emit such warning in some version of GHC?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As an example, GHC 8.10 prints
-Wunrecognised-pragmas
as a single line warningThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
9.6.4 does print it as a multiline, so
ithink it's changed so that it's not possible to get a single-line error/warning with(edit i was wrong), although as shown earlier 9.6 also has unnumbered warnings[GHC-*]
edit no it looks like single line is still possible if we turn up the available columns for the pretty printer
-dppr-cols=150
, which is imo fair because like, i have that many columns on the terminal! it's also probably a good idea to handle this to cover all bases