www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - [SAOC 2024] Improve D Error Messages - Weekly Update #6



This week, I focused on enhancing SARIF support by implementing 
new features, adjusting formatting, and ensuring schema adherence.



- **Key PRs:**
   1. feat(errors): implement SARIF support as a MessageStyle- 
https://github.com/dlang/dmd/pull/17016)
   2. fix(errors): adhere to SARIF 2.1.0 schema- 
https://github.com/dlang/dmd/pull/17020)
   3. refactor(errors): move SARIF logic to sarif.d- 
https://github.com/dlang/dmd/pull/17025)
   4. fix(errors): skip normal error output when SARIF is enabled- 
https://github.com/dlang/dmd/pull/17030)
   5. feat(errors): integrate warnings and enhance SARIF 
https://github.com/dlang/dmd/pull/17032)

- **Multiple Error Handling in SARIF Reporting:**
I worked on enabling SARIF to handle multiple error messages 
within a single report. This involved modifying three files to 
accumulate errors in `sarif.d` using a global array that captured 
messages from `errors.d`. After compilation, `mars.d` called a 
function in `sarif.d` to generate the final report. While the 
integrated setup didn’t work as expected, a standalone version 
([sarifmultiple](https://github.com/royalpinto007/d-drafts/blob/main/s
rif_accumulator.d)) was successful, indicating some more adjustments are still
needed in integration.



- **SARIF Report Hook Placement:**
I’m considering where best to place the final report call. Should 
this function be called at the end of `createModules` in 
`mars.d`, or is there a more optimal location?



- I’ll work on ensuring consistent error accumulation across the 
compiler and adding SARIF support for successful executions.
Oct 27