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

CI: Add git-clang-format #595

Commits on Apr 23, 2021

  1. ci: Adjust to existing code

    Avoid bash only "[[" and "]]", access variables with curly braces and
    quote them.
    rettichschnidi committed Apr 23, 2021
    Configuration menu
    Copy the full SHA
    ec6fa57 View commit details
    Browse the repository at this point in the history
  2. ci: Fix typo

    Checkpatch is not even used in this project.
    rettichschnidi committed Apr 23, 2021
    Configuration menu
    Copy the full SHA
    6e19254 View commit details
    Browse the repository at this point in the history

Commits on Apr 26, 2021

  1. [eclipse-wakaamaGH-574] ci: Configure and integrate clang-format

    git-clang-format ensures that all *new* code being submitted adheres to
    the format dictated by clang-format.
    
    The code style is based on LLVM (the creator of clang-format), but with
    4 instead of 2 spaces indent width and a maximum of 120 instead of 80
    characters per line in order to blend in well with existing code.
    
    Please note:
    - The er-coap-13 code gets exempt, as at some point, we probably want to
      to interact with whatever upstream there might be. For those files,
      just do what existing code does (which varies every few lines).
    - Default is clang-format-10, which is available in the Ubuntu 20.04
      GitHub runner.
    rettichschnidi committed Apr 26, 2021
    Configuration menu
    Copy the full SHA
    af1eb89 View commit details
    Browse the repository at this point in the history
  2. [eclipse-wakaamaGH-574] clang-format: Cleaning up Eclipse header

    I used the following script:
    
    for f in $(find . -type f \( -name '*.c' -or -name '*.h' \) \
        -not -path '*/examples/shared/tinydtls/*' \
        -not -path '*/coap/er-coap-13/*'); do
          end="$(grep --line-number --extended-regexp "\\*{70}/" "${f}" |
            awk -F: '{print $1}')"
          echo "Formatting ${f}, line 1 to ${end}"
          clang-format-10 -i --lines="1:${end}" "${f}"
    done
    rettichschnidi committed Apr 26, 2021
    Configuration menu
    Copy the full SHA
    6a458fb View commit details
    Browse the repository at this point in the history
  3. [eclipse-wakaamaGH-574] blame: Declare Eclipse header cleanup

    The last commit was purely cosmetic. Therefore, adding it to
    .git-blame-ignore-revs.
    rettichschnidi committed Apr 26, 2021
    Configuration menu
    Copy the full SHA
    686f297 View commit details
    Browse the repository at this point in the history
  4. ci: Describe running locally

    Doing so gives the developer feedback early on, before the changes hit
    the GitHub CI infrastructure.
    
    This would be a good candidate for using a Git pre-hook. Unfortunately,
    gitlint is a bit tricky to be used in a pre-push hook:
    jorisroovers/gitlint#55
    rettichschnidi committed Apr 26, 2021
    Configuration menu
    Copy the full SHA
    132e152 View commit details
    Browse the repository at this point in the history