diff --git a/.github/workflows/ci-scripts-build.yml b/.github/workflows/ci-scripts-build.yml index 2bb9da2..b26e300 100644 --- a/.github/workflows/ci-scripts-build.yml +++ b/.github/workflows/ci-scripts-build.yml @@ -35,9 +35,9 @@ jobs: steps: - uses: actions/checkout@v2 - name: clang-format check - uses: jidicula/clang-format-action@v4.8.0 + uses: jidicula/clang-format-action@v4.11.0 with: - clang-format-version: '14' + clang-format-version: '16' check-path: 'ek9000App' exclude-regex: 'terminals.h' diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..281f94a --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,15 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.4.0 + hooks: + - id: no-commit-to-branch + - id: check-merge-conflict + - id: check-json + - id: check-symlinks + - id: fix-byte-order-marker + - id: check-ast + - repo: https://github.com/pre-commit/mirrors-clang-format + rev: v16.0.6 + hooks: + - id: clang-format + types_or: [c++, c] diff --git a/ek9000App/src/devEK9000.cpp b/ek9000App/src/devEK9000.cpp index 1395a89..860708c 100644 --- a/ek9000App/src/devEK9000.cpp +++ b/ek9000App/src/devEK9000.cpp @@ -41,7 +41,7 @@ #include /* Modbus or asyn includes */ -//#include +// #include #include #include diff --git a/ek9000App/src/ekUtil.h b/ek9000App/src/ekUtil.h index c3dd5e4..25c5de0 100644 --- a/ek9000App/src/ekUtil.h +++ b/ek9000App/src/ekUtil.h @@ -168,11 +168,15 @@ namespace util #if __cplusplus >= 201103L using std::is_same; #else -template struct is_same { static bool value; }; +template struct is_same { + static bool value; +}; template bool is_same::value = false; -template struct is_same { static bool value; }; +template struct is_same { + static bool value; +}; template bool is_same::value = true; #endif @@ -200,7 +204,7 @@ concept INPUT_RECORD = requires(T a) { } // namespace detail template -concept RECORD_TYPE = detail::BASE_RECORD &&(detail::INPUT_RECORD || detail::OUTPUT_RECORD); +concept RECORD_TYPE = detail::BASE_RECORD && (detail::INPUT_RECORD || detail::OUTPUT_RECORD); template concept NUMERIC_TYPE = std::same_as || std::same_as || std::same_as ||