Git Product home page Git Product logo

gcc-problem-matcher's Introduction

gcc-problem-matcher

Github Action to problem match output from gcc. This allows warnings and errors from the compiler to be prominently featured in pull requests like so:

Matcher in action in pull request

This is a direct port of the $gcc rule from vscode-cpptools. Typical usage will be:

    - uses: ammaraskar/gcc-problem-matcher@master
    - name: Build Project
      run: make

Note that this action does not build your code for you. It only makes the errors and warnings from your compiler more prominent.

Development

Keep this up-to-date with the upstream vscode-cpptools gcc matcher: https://github.com/microsoft/vscode-cpptools/blob/a8285cbc0efb5b09c2d2229b0e0772dcb3b602df/Extension/package.json#L76-L94

gcc-problem-matcher's People

Contributors

ammaraskar avatar peternewman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

gcc-problem-matcher's Issues

Incomplete capture scope for warnings

/^(?:(?:[^\s:]*): In .*\r?\n)?([^\s:]+):(\d+):(\d*):?\s+(?:fatal\s+)?(warning|error):\s+(.*)\r?\n(?:(?:\s+|In file included).*\r?\n)*(?:[^\s:]+:\d+:\d*:?\s+note:\s+.*\r?\n(?:(?:\s+|In file included).*\r?\n)*)*/

The full message (not just a regular expression locating the warning / error itself!) has a couple more lines of code.

Check this for example against:

/build/bzip2/compress.cpp: In function ‘void my_lib::bzip2::sendValues()’:
/build/bzip2/compress.cpp:365:30: warning: ISO C++1z does not allow ‘register’ storage class specifier [-Wregister]
             register int32_t a, b, c;
                              ^~~~~~
/build/bzip2/compress.cpp:365:30: note: ... don't do it.
In file included from /builds/a.h:10:0,
                 from /builds/b.h:11,
                 from /builds/c.h:27:

That's all just one single error message - and unless you plan on heading back to the full log just to understand the context, there's simply not enough captured by this problem matcher.

There is additional context before, and after the context captured in the current state.

automated comments on PR not working

Hi all

This github action is really interesting and I tried to use it. I managed to have it highlight the warnings in the build log but it does not create comments on the files. The screenshot in the README shows an example of such a comment I would like to have.

Is this action supposed to create these comments or do I have to combine it with another action to achieve that?

best regards

Ignore certain folders from being matched

Since Github only shows 10 warnings in a run, it'd be nice if they were all from the actual project and not from a dependency, being able to ignore third_party, external, subprojects folders would be nice

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.