streetsidesoftware / cspell

A Spell Checker for Code!
https://cspell.org
MIT License
1.2k stars 91 forks source link

Provide a Junit compliant reporter #4570

Open LasneF opened 1 year ago

LasneF commented 1 year ago

Describe the solution you'd like CSpell is definitively a great tool to include inside a CICD many CICD solution includes capability to report , track , issues leveraging the JUnit format

here leveraging Cspell reporter capability, the feature would be to add a Junit Reporter so thatn the output can be leveraged inside a CICD .

junit format could be minimal like

<testsuite tests="3">
  <testcase classname="File1" name"/>
  <testcase classname="File2" name="AnotherSuccessfulTest"/>
  <testcase classname="foo3" name="AFailingTest">
               <failure type="prohibited word"> zzz </failure>
</testcase>
</testsuite>

Additional context My context is about leveraging CSpell as a linter for Open API file

Jason3S commented 1 year ago

@LasneF,

Custom reporters are already possible. There is an example here: https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell-json-reporter

A PR to add cspell-junit-reporter is welcome. If you would like us to develop it for you, please visit: Support - Street Side Software.

Kind regards, Jason

jkrenzer commented 4 months ago

I started to work on a quite simple and crude implementation of a junit.xml reporter. See https://github.com/jkrenzer/cspell-junit-reporter for the source-code. Quite obviously I tried to stay as close to the cspell-json-reporter example as possible.

Currently Gitlab does read the generated files, but it is still very basic and the code is not stable. Use at your own risk, contributions are welcome.

Kind regards, Jörn