From 488d7532e78832b9f7e698bae81dc4dd17981e9f Mon Sep 17 00:00:00 2001 From: Klagarge Date: Sat, 4 Jan 2025 15:14:28 +0100 Subject: [PATCH] ADD pre-commit config --- mbed-os-bootloader/.clang-format | 12 ++++++++++ mbed-os-bootloader/.pre-commit-config.yaml | 26 ++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 mbed-os-bootloader/.clang-format create mode 100644 mbed-os-bootloader/.pre-commit-config.yaml diff --git a/mbed-os-bootloader/.clang-format b/mbed-os-bootloader/.clang-format new file mode 100644 index 0000000..3e33698 --- /dev/null +++ b/mbed-os-bootloader/.clang-format @@ -0,0 +1,12 @@ +--- +BasedOnStyle: Google +IndentWidth: 4 +--- +Language: Cpp +ColumnLimit: 90 +AlignConsecutiveAssignments: true +DerivePointerAlignment: false +PointerAlignment: Left +BinPackArguments: false +BinPackParameters: false +IndentAccessModifiers: false \ No newline at end of file diff --git a/mbed-os-bootloader/.pre-commit-config.yaml b/mbed-os-bootloader/.pre-commit-config.yaml new file mode 100644 index 0000000..c6018cc --- /dev/null +++ b/mbed-os-bootloader/.pre-commit-config.yaml @@ -0,0 +1,26 @@ +files: ^main.cpp +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.3.0 + hooks: + - id: check-yaml + args: [--allow-multiple-documents] + - id: end-of-file-fixer + - id: trailing-whitespace + - repo: https://github.com/pre-commit/mirrors-clang-format + rev: "v14.0.6" + hooks: + - id: clang-format + - repo: https://github.com/cpplint/cpplint + rev: "1.6.1" + hooks: + - id: cpplint + name: cpplint + entry: cpplint --linelength=90 --filter=-build/include_subdir,-whitespace/indent,-build/namespaces,-build/c++11 + - repo: local + hooks: + - id: cppcheck + name: cppcheck + require_serial: true + entry: cppcheck --enable=all --suppress=missingInclude --inline-suppr -i mbed-os --std=c++14 --error-exitcode=1 + language: system