Coder Social home page Coder Social logo

run-cppcheck's Introduction

cppcheck-action

A simple Cppcheck static code analysis for GitHub Actions

Example usage

In you workflow file, first checkout the repository (using, for instance, a simple but powerful actions/checkout@v2 action)

jobs:
  analyse:
    name: Run Cppcheck
    runs-on: ubuntu-latest
    steps:
    - name: Check out repository
      uses: actions/checkout@v2
      with:
        depth: 1
        submodules: 'recursive'

then continue with this action:

    - name: Run Cppcheck
      uses: Bedzior/[email protected]
      with:
        enabled checks: all
        enable inconclusive: true
        generate report: true

This will enable all Cppchecks, including inconclusive ones, and generate the report in output directory. Uploading the result is then as trial as calling:

    - name: Upload report
      uses: actions/upload-artifact@v1
      with:
        name: report
        path: output

Enjoy!

Full reference

debug

description: 'Debug script run to troubleshoot configuration errors'
required: false
default: false

This is here to ease troubleshooting, resolving issues and for developers' convenience. Uses set -x to see commands passed to sh

enabled checks

description: 'Which checks are enabled'
required: false
default: 'all'

See wiki for a full reference.

enable inconclusive

description: 'Enable inconclusive checks'
required: false
default: false

exclude from check

description: 'Which directories or files to exclude from analysis; format: paths prefixed with `-i`, space-delimited'
required: false
default: ''

For now it's a space-delimited list of paths, each prefixed with -i. E.g.

  • -ivendor
  • -itools -iexternals -isrc/single_file_library.c

generate report

description: 'Whether to generate an XML and HTML reports'
required: false
default: true

include directories

description: 'Include paths; format: directories prefixed with `-I`, space-delimited'
required: false
default: ''

For now it's a space-delimited list of directories, each prefixed with -I. E.g.

  • -I3rdparty/super_library/include
  • -Iincludes -Iexternal/includes

path

description: 'Path to your project, passed directly to Cppcheck'
required: true
default: '.'

report name

description: 'Name of your report'
required: false
default: ${{ github.repository }}

Report title, displayed in resulting index.html

verbose

description: 'Verbose Cppcheck error descriptions'
required: false
default: false

For all those wishing to know, exactly why something was marked as dubious or wrong by Cppcheck

Acknowledgments

Docker image's source code is available here

This action makes use of Cppcheck, which is a great open-source tool I can recommend.

I would like to thank dbeef for providing a suiting testbed for this GitHub Action in form of his spelunky-psp project repository. Check it out here!

License

All content in this repository is licensed under the MIT License.

Copyright (c) 2020 Rafał Będźkowski

run-cppcheck's People

Contributors

bedzior avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.