Correctly detect file-local NoUnicodeSyntax - #5078
Merged
Merged
Conversation
fendor
approved these changes
Sep 9, 2026
fendor
left a comment
Collaborator
There was a problem hiding this comment.
LGTM, one nitpick and a suggestion that I am fine to do in a follow-up
Comment on lines
+164
to
+178
| $ let cabalFile = [ | ||
| "cabal-version: 3.4", | ||
| "name: foo", | ||
| "version: 0.1.0.0", | ||
| "build-type: Simple", | ||
| "common warnings", | ||
| " ghc-options: -Wall", | ||
| "library", | ||
| " import: warnings", | ||
| " exposed-modules: TUnicodeArrow", | ||
| " build-depends: base", | ||
| " hs-source-dirs: .", | ||
| " default-language: GHC2024" | ||
| ] | ||
|
|
Collaborator
There was a problem hiding this comment.
It would have honestly been far easier to write a direct cradle test like this:
cradle:
direct:
arguments:
- Module
- -XGHC2024
Since you care about the base arguments to GHC, rather than that it is a cabal project.
We can merge as is, create an issue to convert it to a direct cradle test.
Direct cradle tests are much faster since we don't need to load the cabal context.
Collaborator
Author
There was a problem hiding this comment.
Ok, I'll create an issue for that.
To understand a bit more, do you mean that I would write
$ let cradleFile = [
"cradle:",
" direct:",
" arguments:",
" - Module",
" - -XGHC2024",
]and, similarly to what I've done, I'd add another line to mean "add UnicodeSyntax" / "add NoUnicodeSyntax"?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This change contains:
a relatively small edit to take into account possible
{-# LANGUAGE UnicodeSyntax #-}/{-# LANGUAGE NoUnicodeSyntax #-}in the file being edited, and to treat those with higher priority than the corresponding flags in (corresponding stanza in) the.cabalfile,a test that looks a bit ugly right now;
Regarding 2, my intent is to test for the 9 combinations of
{-# LANGUAGE UnicodeSyntax #-}/{-# LANGUAGE NoUnicodeSyntax #-}/neither × corresponding 3 alternatives in the.cabalfile, and I've tried, but the code looks messy…Suggestions?
Fix #5067.