Files
fprime/.github/scripts/cpplint-xml2text.xslt
Thibault d5a65b48df Add Cpplint Static Code Analysis to CI Workflow (#1794)
* Add Cpplint Static Code Analysis to CI Workflow

* Fix spell check & typo

* Update cpplint triggering policy

* Add `linelength` fword from CppLint to SpellCheck

* Export `Cpplint` policy into `CPPLINT.cfg`

* Fix Spellcheck `Unrecognized words (2)`

* Remove some rule filters to reduce scan errors.

Asked by @thomas-bc: https://github.com/nasa/fprime/pull/1794#pullrequestreview-1226906932

* Use `set` to check membership of a collection of literals

* Refactor `cpplint_to_cppcheckxml.py`

* Remove remaining `filter=+build/header_guard`

* Remove `checkout_path` froù upload-sarif action

* Rename job from `cppcheck` to `cpplint` in CppLint workflow

* Fix tool name in SARIF

Co-authored-by: Thomas Boyer Chammard <49786685+thomas-bc@users.noreply.github.com>
2023-01-26 10:37:21 -08:00

18 lines
939 B
HTML

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="text" encoding="UTF-8"/>
<xsl:template match="/">## CppLint <xsl:value-of select="//cppcheck/@version"/> Summary
<xsl:if test="count(//error) > 0">
| error | warning | style |
| --- | --- | --- |
| <xsl:value-of select="count(//error[@severity='error'])"/> | <xsl:value-of select="count(//error[@severity='warning'])"/> | <xsl:value-of select="count(//error[@severity='style'])"/> |
| severity | location | error id | issue |
| --- | --- | --- | --- |
<xsl:for-each select="results//error">| <xsl:value-of select="@severity"/> | <xsl:value-of select="location/@file"/>:<xsl:value-of select="location/@line"/> | <xsl:value-of select="@id"/> | <xsl:value-of select="@msg"/> |
</xsl:for-each>
</xsl:if>
**<xsl:value-of select="count(//error[@severity='error'])"/> error(s) reported**
</xsl:template>
</xsl:stylesheet>