arduino / arduino-cli

Arduino command line tool
https://arduino.github.io/arduino-cli/latest/
GNU General Public License v3.0
4.24k stars 371 forks source link

Add diagnostics in the preprocessor #2515

Closed alessio-perugini closed 4 months ago

alessio-perugini commented 5 months ago

Please check if the PR fulfills these requirements

See how to contribute

What kind of change does this PR introduce?

We're adding the diagnostics in the preprocessing part.

What is the current behavior?

Currently, the diagnostics are considered only for the sketch compilation.

What is the new behavior?

The diagnostics field will report errors from the preprocessor and the compiler.

Does this PR introduce a breaking change, and is titled accordingly?

Other information

I'm proposing to use a struct that Stores the information of the diagnostics instead of using a callback approach. We can always revert that.

codecov[bot] commented 5 months ago

Codecov Report

Attention: 38 lines in your changes are missing coverage. Please review.

Comparison is base (205a6a5) 68.92% compared to head (be0b8c4) 69.74%. Report is 7 commits behind head on master.

Files Patch % Lines
...lder/internal/preprocessor/arduino_preprocessor.go 0.00% 12 Missing :warning:
...rnal/arduino/builder/internal/detector/detector.go 46.66% 6 Missing and 2 partials :warning:
...rnal/arduino/builder/internal/diagnostics/store.go 57.89% 6 Missing and 2 partials :warning:
...nal/arduino/builder/internal/preprocessor/ctags.go 61.11% 7 Missing :warning:
...ernal/arduino/builder/internal/preprocessor/gcc.go 40.00% 3 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #2515 +/- ## ========================================== + Coverage 68.92% 69.74% +0.82% ========================================== Files 204 206 +2 Lines 20452 20845 +393 ========================================== + Hits 14096 14538 +442 + Misses 5207 5166 -41 + Partials 1149 1141 -8 ``` | [Flag](https://app.codecov.io/gh/arduino/arduino-cli/pull/2515/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=arduino) | Coverage Δ | | |---|---|---| | [unit](https://app.codecov.io/gh/arduino/arduino-cli/pull/2515/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=arduino) | `69.74% <61.22%> (+0.82%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=arduino#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.