GithubHelp home page GithubHelp logo

coding_standard_setup's Introduction

Coding Style

Repository Structure

  • dot-files
  • git-hooks
  • examples
  • linter.py
  • install.sh
  • style.md
  • (README.md)

The "dot-files" contains configuration files for git and clang. Those files are usually located in the home or .git directory and precedet with a dot to be hidden on default.

The "git-hooks" contain shell scripts which are automatically triggered by running the corresponding git command.

The "examples" directory contains sample files such as commit messages.

The "linter.py" python script gets called by the "pre-commit" hook for verifying the correct formatting of the code as well as for performing static code analysis. The logic for handling different programming languages should be added to the "linter.py" script.
Additionally, a ".lint_ignore" file can be manually added to the toplevel of a git repository. Files or directories which should be ignored by "linter.py" are added to this file.

The "install.sh" shell script installs the git hooks and commit message template to the target repository.

The "style.md" file can be used as a reference for the rules which are applied to C/C++ source files.

Apply Settings

Use the "install.sh" script to install the git hooks to the target repository.

The script sets up symbolic links to the hooks located in the "git-hooks" directory of this repository. This way updates to either of the hooks are automatically reflected in the repositories which were previously setup.

Dependencies

The following packages are required:

  • clang-format
  • cppcheck
  • python3

Known Issues

Clang-format is currently not able to automatically detect or insert missing newlines between functions, as shown by the example below. This feature is only available for clang-format from version 14 onwards. Check files manually to make sure functions are separated by a newline.

void function1()
{
    ...
}
void function2()
{
}

Configuration option for clang-format from 14 onwards.

SeparateDefinitionBlocks : Always

coding_standard_setup's People

Contributors

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