-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor config file & custom rewrites #225
Conversation
and make more config fields optional
+ be consistent with commas in cabal config
Done with this first refactor. Feedback welcome. We don't have tests for config files yet but I won't make it part of this PR. All commits more or less self-standing and passing tests. |
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 looks great to me, thanks!
RecordWildCards | ||
FlexibleContexts | ||
MultiWayIf | ||
TupleSections |
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.
Oh wow, you can skip the commas? TIL.
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! The syntax is surprisingly flexible (unfortunately, probably), though the documentation seems incorrect. I tried trailing commas for build-depends
and it wasn't allowed.
Been looking at more of the source code to try and understand what's going on before I start implementing the enhancements mentioned earlier.
I had missed the fact that we now have support of custom user rewrites. The code seemed very hard to maintain so I went ahead and simplified the parsing of config files (now depending on
yaml
andaeson
, the latter already being a dependency of Agda).I changed the flag
--rewrite-rules
to--config
as it appears the file already contains more than rewrite rules (e.g: prelude import options). And it's likely we will use the config for more.The config isn't parsed using
unsafeIO
anymore when parsing CLI options, but rather fetched safely using thepreCompile
hook of the backend.Still need to update the documentation.