Giter VIP home page Giter VIP logo

clang-tidy-misra's Introduction

About Build Status

clang-tidy-misra is a collection of MISRA compliance checkers for clang-tidy.

Progress

This project is in an early stage and has not yet been tested extensively!

If and how each rule can be checked:

Explanation for the "Supported by" column:

  • TBD: "To Be Determined" - Rule has not yet been looked at at all
  • unchecked: Rule can not (yet) be checked at all
  • unchecked (document): Unchecked and likely uncheckable by a compiler
  • -...: Enforceable by enabling this option when invoking the compiler
  • misra-...: Checker developed by us is able to check this rule
  • ...: Checkable by the vanilla clang-tidy checker

Work plan

Work to do, not necessarily in the listed order:

  • Implement/Cover as many rules as possible
  • Integrate all checkers into a unified web front end that supports the user with the creation of all the necessary documentation (compliance matrix, deviations, sign-offs, etc.) to achieve MISRA compliance

Installation

No documentation so far. .circleci/config.yml and buildagent/build.sh may be useful.

Bugs

When reporting a bug, please include a code snippet which triggers the flaw.

Contribute a checker

  • Check the test-wishlist folder for already existing test code
  • Move/Add a file, e.g. 10-3-2.cpp with test cases to the test folder
  • Make sure existing can not yet check this rule
  • clang-tidy -checks=* 10-3-2.cpp
  • clang++ -fsyntax-only -Weverything 10-3-2.cpp
  • Add support for this rule
  • Implement checker logic if needed - Dumping the AST of your test code may help you
  • If vanilla Clang/clang-tidy does the trick, adapt the test
  • Call make check-tidy-misra in the build directory to run the tests
  • Highly recommended: Let the new checker run on your embedded project(s) to make sure it works as intended
  • Commit and create a pull request

In case you figure that you can not come up with some usable checker logic, instead of hiding away or deleting your test code, please move it from test to test-wishlist where it can be picked up by someone else.

Coding Style

This project follows (tries to...) the LLVM Coding Standard. At the very least the code has to be formatted using clang-format and the LLVM coding style.

For testing code feel free to lift the restrictions as necessary. For example, by using the .clang-format file in the test directory.

Running Tests

make check-tidy-misra

Usage

Enable the rules misra-* when using clang-tidy.

clang-tidy-misra's People

Contributors

rettichschnidi 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.