Reduce the lines required for the project error reports
- Dominant language
- Haskell
- Stars
- 1.7k
- Forks
- 750
- Avg merge
- 4d 3h
- Merged PRs (30d)
- 28
Description
Could we reduce the lines required for the error reports? Perhaps lead with the error line and append the error code and problem description the way GHC does it?
```
[ 37 of 150] Compiling Distribution.Types.DumpBuildInfo ( src/Distribution/Types/DumpBuildInfo.hs, interpreted ) [Source file changed]
src/Distribution/Types/DumpBuildInfo.hs:25:31: error: [GHC-88464]
Variable not in scope: boolean :: Bool
|
25 | boolToDumpBuildInfo bool = if boolean then DumpBuildInfo else NoDumpBuildInfo
| ^^^^^^^
```
_Originally posted by @philderbeast in https://github.com/haskell/cabal/pull/8889#discussion_r2213550663_
That would give us:
```
cyclical-0-self.project:3:1: error: [Cabal-7090]
cyclical import of cyclical-0-self.project;
cyclical-0-self.project
imported by: cyclical-0-self.project
1 | packages: .
2 |
3 | import: cyclical-0-self.project
| ^
```
Do we even need to say that we found the problem while parsing?
Contributor guide
Research direction
Start at the project-file parsing error path illustrated by cyclical-0-self.project and compare its current report with the GHC-style example. Trace how the cyclical import diagnostic is assembled; done means the report leads with the location and error code, preserves the description and source excerpt, and omits unnecessary parsing wording.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- haskell
- Domain
- cli, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100