-
Notifications
You must be signed in to change notification settings - Fork 710
Reimplement cabal check
#8211
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
Comments
First batch of tests here: #8248 There is quite some work to do. |
With #8248 and #8250 merged (105 tests in total) the “write a testsuite” box is checked. We are now reasonably sure reimplementation won’t break current behaviour; we are now reasonably sure in the future we will be warned if a check becomes redundant (e.g. because of improved parsing). Next step: convert |
With #8269 merged (structured errors), half of the work is hopefully done. Next steps: study Once ready: write a short implementation proposal. |
@ffaf1: Great work so far! Please remember to submit your Contributor Midterm Evaluation to GSoc by tomorrow! |
Thanks for the reminder, will do! |
edit: done! The meat of this is in #8427, thanks everyone for helping!
Where are we now
cabal check
is a tool to check the correctness of a.cabal
file and more generally to provide additional useful output (warnings, especially related to uploading the package to Hackage).As now
cabal check
is an imprecise tool: simple example (#7423), where-O2
gets a warning even when it is passed under a (cabal) flag.A number of these errors are caused by the way the checker operates today. Immediately noticeable: inefficiency (we go through
pkg
numerous times), lack of scoping awareness.Where we want to be
The correct way to tackle the problem is to:
check
is a fairly complex system in some of its part and this will minimise risks of disruption to the users.GenericPackageDescription
once. So traverse the AST focusing on what we need (and not a bit more) in each step.Steps to achieve the goal
cabal check
to behave. We should scoop as much as possible from the issues in the issue tracker. The resulting modifications will have the shape of a number of small pull requests, easy to parse and easily mergeable. Done incabal check
testuite: add sanity checks #8248 andcabal-check
testsuite: add Package/File tests #8250.checkPackage
to pattern match onGenericPackageDescription
(instead of using accessors). This buys us the peace of mind that ifGenericPackageDescription
is modified (fields added), then a compilation error will gently point the user to add relevant tests. This should a slightly bigger modification and maybe not uncontroversial (accessors are handier than pattern matching a big type). Done in Reimplementcabal check
#8427.cabal check
errors (as now they areString
s). Again a propaedeutic task, this should be relatively self contained and uncontroversial. Done incabal check
: add typed errors #8269.Cabal
codebase means more to rewrite). Done again in Reimplementcabal check
#8427, had to rebase/squash commits as cabal introduced autoformatters meanwhile.This issue will be useful to document development and gather comments.
The text was updated successfully, but these errors were encountered: