Skip to content
This repository has been archived by the owner on Mar 2, 2024. It is now read-only.

Commit

Permalink
Documenting parsers as a table
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasbjerre committed Sep 22, 2018
1 parent b2ab9ee commit 3758f85
Showing 1 changed file with 62 additions and 58 deletions.
120 changes: 62 additions & 58 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,66 +4,70 @@ This is a Gradle plugin for [Violation Comments to GitLab Lib](https://github.co

It can parse results from static code analysis and comment merge requests in GitLab with them.

You can have a look at [violations-test](https://gitlab.com/tomas.bjerre85/violations-test/merge_requests/1) to see what the result may look like.

The **merge must be performed first** in order for the commented lines in the MR to match the lines reported by the analysis tools!

It supports:
* [_AndroidLint_](http://developer.android.com/tools/help/lint.html)
* [_Checkstyle_](http://checkstyle.sourceforge.net/)
* [_Detekt_](https://github.com/arturbosch/detekt) with `--output-format xml`.
* [_ESLint_](https://github.com/sindresorhus/grunt-eslint) with `format: 'checkstyle'`.
* [_KTLint_](https://github.com/shyiko/ktlint)
* [_SwiftLint_](https://github.com/realm/SwiftLint) with `--reporter checkstyle`.
* [_TSLint_](https://palantir.github.io/tslint/usage/cli/) with `-t checkstyle`
* [_PHPCS_](https://github.com/squizlabs/PHP_CodeSniffer) with `phpcs api.php --report=checkstyle`.
* [_CLang_](https://clang-analyzer.llvm.org/)
* [_RubyCop_](http://rubocop.readthedocs.io/en/latest/formatters/) with `rubycop -f clang file.rb`
* [_GCC_](https://gcc.gnu.org/)
* [_ARM-GCC_](https://developer.arm.com/open-source/gnu-toolchain/gnu-rm)
* [_Doxygen_](https://www.stack.nl/~dimitri/doxygen/)
* [_CodeNarc_](http://codenarc.sourceforge.net/)
* [_CPD_](http://pmd.sourceforge.net/pmd-4.3.0/cpd.html)
* [_CPPLint_](https://github.com/theandrewdavis/cpplint)
* [_CPPCheck_](http://cppcheck.sourceforge.net/)
* [_CSSLint_](https://github.com/CSSLint/csslint)
* [_DocFX_](http://dotnet.github.io/docfx/)
* [_Findbugs_](http://findbugs.sourceforge.net/)
* [_Spotbugs_](https://spotbugs.github.io/)
* [_Flake8_](http://flake8.readthedocs.org/en/latest/)
* [_AnsibleLint_](https://github.com/willthames/ansible-lint) with `-p`
* [_Mccabe_](https://pypi.python.org/pypi/mccabe)
* [_Pep8_](https://github.com/PyCQA/pycodestyle)
* [_PyFlakes_](https://pypi.python.org/pypi/pyflakes)
* [_FxCop_](https://en.wikipedia.org/wiki/FxCop)
* [_Gendarme_](http://www.mono-project.com/docs/tools+libraries/tools/gendarme/)
* [_GoLint_](https://github.com/golang/lint)
* [_GoVet_](https://golang.org/cmd/vet/) Same format as GoLint.
* [_GoogleErrorProne_](https://github.com/google/error-prone)
* [_NullAway_](https://github.com/uber/NullAway) Same format as Google Error Prone.
* [_JSHint_](http://jshint.com/)
* _Lint_ A common XML format, used by different linters.
* [_JCReport_](https://github.com/jCoderZ/fawkez/wiki/JcReport)
* [_Klocwork_](http://www.klocwork.com/products-services/klocwork/static-code-analysis)
* [_KotlinMaven_](https://github.com/JetBrains/kotlin) Output from Kotlin Maven Plugin.
* [_KotlinGradle_](https://github.com/JetBrains/kotlin) Output from Kotlin Gradle Plugin.
* [_MyPy_](https://pypi.python.org/pypi/mypy-lang)
* [_PCLint_](http://www.gimpel.com/html/pcl.htm) PC-Lint using the same output format as the Jenkins warnings plugin, [_details here_](https://wiki.jenkins.io/display/JENKINS/PcLint+options)
* [_PerlCritic_](https://github.com/Perl-Critic)
* [_PiTest_](http://pitest.org/)
* [_PyDocStyle_](https://pypi.python.org/pypi/pydocstyle)
* [_PyLint_](https://www.pylint.org/) with `pylint --output-format=parseable`.
* [_PMD_](https://pmd.github.io/)
* [_Infer_](http://fbinfer.com/) Facebook Infer. With `--pmd-xml`.
* [_PHPPMD_](https://phpmd.org/) with `phpmd api.php xml ruleset.xml`.
* [_ReSharper_](https://www.jetbrains.com/resharper/)
* [_SbtScalac_](http://www.scala-sbt.org/)
* [_Simian_](http://www.harukizaemon.com/simian/)
* [_StyleCop_](https://stylecop.codeplex.com/)
* [_XMLLint_](http://xmlsoft.org/xmllint.html)
* [_YAMLLint_](https://yamllint.readthedocs.io/en/stable/index.html)
* [_ZPTLint_](https://pypi.python.org/pypi/zptlint)

Example of supported reports are available [here](https://github.com/tomasbjerre/violations-lib/tree/master/src/test/resources).

A number of **parsers** have been implemented. Some **parsers** can parse output from several **reporters**.

| Parser | Reporter | Notes
| --- | --- | ---
| `ANDROIDLINT` | [_AndroidLint_](http://developer.android.com/tools/help/lint.html) |
| `CHECKSTYLE` | [_Checkstyle_](http://checkstyle.sourceforge.net/) |
| | [_Detekt_](https://github.com/arturbosch/detekt) | with `--output-format xml`.
| | [_ESLint_](https://github.com/sindresorhus/grunt-eslint) | with `format: 'checkstyle'`.
| | [_KTLint_](https://github.com/shyiko/ktlint) |
| | [_SwiftLint_](https://github.com/realm/SwiftLint) | with `--reporter checkstyle`.
| | [_TSLint_](https://palantir.github.io/tslint/usage/cli/) | with `-t checkstyle`
| | [_PHPCS_](https://github.com/squizlabs/PHP_CodeSniffer) | with `phpcs api.php --report=checkstyle`.
| `CLANG` | [_CLang_](https://clang-analyzer.llvm.org/) |
| | [_RubyCop_](http://rubocop.readthedocs.io/en/latest/formatters/) | with `rubycop -f clang file.rb`
| | [_GCC_](https://gcc.gnu.org/)
| | [_ARM-GCC_](https://developer.arm.com/open-source/gnu-toolchain/gnu-rm)
| | [_Doxygen_](https://www.stack.nl/~dimitri/doxygen/)
| `CODENARC` | [_CodeNarc_](http://codenarc.sourceforge.net/)
| `CPD` | [_CPD_](http://pmd.sourceforge.net/pmd-4.3.0/cpd.html)
| `CPPLINT` | [_CPPLint_](https://github.com/theandrewdavis/cpplint)
| `CPPCHECK` | [_CPPCheck_](http://cppcheck.sourceforge.net/)
| `CSSLINT` | [_CSSLint_](https://github.com/CSSLint/csslint)
| `DOCFX` | [_DocFX_](http://dotnet.github.io/docfx/)
| `FINDBUGS` | [_Findbugs_](http://findbugs.sourceforge.net/)
| | [_Spotbugs_](https://spotbugs.github.io/)
| `FLAKE8` | [_Flake8_](http://flake8.readthedocs.org/en/latest/)
| | [_AnsibleLint_](https://github.com/willthames/ansible-lint) | with `-p`
| | [_Mccabe_](https://pypi.python.org/pypi/mccabe)
| | [_Pep8_](https://github.com/PyCQA/pycodestyle)
| | [_PyFlakes_](https://pypi.python.org/pypi/pyflakes)
| `FXCOP` | [_FxCop_](https://en.wikipedia.org/wiki/FxCop)
| `GENDARME` | [_Gendarme_](http://www.mono-project.com/docs/tools+libraries/tools/gendarme/)
| `GOLINT` | [_GoLint_](https://github.com/golang/lint)
| | [_GoVet_](https://golang.org/cmd/vet/) | Same format as GoLint.
| `GOOGLEERRORPRONE` | [_GoogleErrorProne_](https://github.com/google/error-prone)
| | [_NullAway_](https://github.com/uber/NullAway) | Same format as Google Error Prone.
| `JSHINT` | [_JSHint_](http://jshint.com/)
| `LINT` | _Lint_ | A common XML format, used by different linters.
| `JCREPORT` | [_JCReport_](https://github.com/jCoderZ/fawkez/wiki/JcReport)
| `KLOCWORK` | [_Klocwork_](http://www.klocwork.com/products-services/klocwork/static-code-analysis)
| `KOTLINMAVEN` | [_KotlinMaven_](https://github.com/JetBrains/kotlin) | Output from Kotlin Maven Plugin.
| `KOTLINGRADLE` | [_KotlinGradle_](https://github.com/JetBrains/kotlin) | Output from Kotlin Gradle Plugin.
| `MYPY` | [_MyPy_](https://pypi.python.org/pypi/mypy-lang)
| `PCLINT` | [_PCLint_](http://www.gimpel.com/html/pcl.htm) | PC-Lint using the same output format as the Jenkins warnings plugin, [_details here_](https://wiki.jenkins.io/display/JENKINS/PcLint+options)
| `PERLCRITIC` | [_PerlCritic_](https://github.com/Perl-Critic)
| `PITEST` | [_PiTest_](http://pitest.org/)
| `PYDOCSTYLE` | [_PyDocStyle_](https://pypi.python.org/pypi/pydocstyle)
| `PYLINT` | [_PyLint_](https://www.pylint.org/) | with `pylint --output-format=parseable`.
| `PMD` | [_PMD_](https://pmd.github.io/)
| | [_Infer_](http://fbinfer.com/) | Facebook Infer. With `--pmd-xml`.
| | [_PHPPMD_](https://phpmd.org/) | with `phpmd api.php xml ruleset.xml`.
| `RESHARPER` | [_ReSharper_](https://www.jetbrains.com/resharper/)
| `SBTSCALAC` | [_SbtScalac_](http://www.scala-sbt.org/)
| `SIMIAN` | [_Simian_](http://www.harukizaemon.com/simian/)
| `STYLECOP` | [_StyleCop_](https://stylecop.codeplex.com/)
| `XMLLINT` | [_XMLLint_](http://xmlsoft.org/xmllint.html)
| `YAMLLINT` | [_YAMLLint_](https://yamllint.readthedocs.io/en/stable/index.html) | with `-f parsable`
| `ZPTLINT` | [_ZPTLint_](https://pypi.python.org/pypi/zptlint)

Missing a format? Open an issue [here](https://github.com/tomasbjerre/violations-lib/issues)!

## Usage ##
There is a running example [here](https://github.com/tomasbjerre/violation-comments-to-gitlab-gradle-plugin/tree/master/violation-comments-to-gitlab-gradle-plugin-example).
Expand Down

0 comments on commit 3758f85

Please sign in to comment.