Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automate C code formatting [1/3] #395

Merged
merged 1 commit into from
Feb 28, 2019

Commits on Feb 28, 2019

  1. Automate C code formatting [1/3]

    Let's introduce an automatic code style formatting and checks for
    Themis. We use clang-format and clang-tidy tools as they are generally
    available and gives reasonable results.
    
    Introduce two new targets for Makefile:
    
      - make fmt
      - make fmt_check
    
    "fmt" is intended for humans to reformat the code before submitting
    changes for review. Currently it formats only C code but it may be
    extended to other languages as well.
    
    "fmt_check" is intended for CI to do format checks to ensure that the
    code is formatted accordingly. Unfortunately, clang-format does not
    have a convenient check mode so we hack one with git diff.
    
    clang-tidy requires the compilation flags so we integrate the format
    checking into the build pipeline. It's a bit repetetive, but also
    gives up a chance to cleanup the build system. And it uses Make
    features nicely so we don't have to recheck and reformat the files
    which are okay.
    
    We start by formatting only Soter and Themis source code. Other parts
    will be added later.
    ilammy committed Feb 28, 2019
    Configuration menu
    Copy the full SHA
    f1f4c69 View commit details
    Browse the repository at this point in the history