Skip to content

Commit

Permalink
MNT: move away from the clang-format action and use our script directly
Browse files Browse the repository at this point in the history
  • Loading branch information
JJL772 committed Aug 16, 2023
1 parent c99ce62 commit 80d243a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 16 deletions.
11 changes: 4 additions & 7 deletions .github/workflows/ci-scripts-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,10 @@ jobs:
name: clang-format formatting check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: clang-format check
uses: jidicula/[email protected]
with:
clang-format-version: '16'
check-path: 'ek9000App'
exclude-regex: 'terminals.h'
- uses: actions/checkout@v3
- run: sudo apt-get update && sudo apt-get -y install clang-format-15
- run: CLANG_FORMAT=clang-format-15 CI=1 ./clang-format.sh


scripts-check:
name: Scripts Check
Expand Down
8 changes: 6 additions & 2 deletions clang-format.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/bin/bash

CLANG_FMT=$(which clang-format-14 || echo "clang-format")
[ -z "$CLANG_FORMAT" ] && CLANG_FORMAT=clang-format

$CLANG_FMT -i $(find . -iname "*.cpp" -o -iname "*.h")
if [[ $CI -eq 1 ]]; then
ARGS="-Werror --dry-run"
fi

$CLANG_FORMAT $ARGS -i $(find . -iname "*.cpp" -o -iname "*.h")
10 changes: 3 additions & 7 deletions ek9000App/src/ekUtil.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,15 +168,11 @@ namespace util
#if __cplusplus >= 201103L
using std::is_same;
#else
template <class T, class U> struct is_same {
static bool value;
};
template <class T, class U> struct is_same { static bool value; };

template <class T, class U> bool is_same<T, U>::value = false;

template <class T> struct is_same<T, T> {
static bool value;
};
template <class T> struct is_same<T, T> { static bool value; };

template <class T> bool is_same<T, T>::value = true;
#endif
Expand Down Expand Up @@ -204,7 +200,7 @@ concept INPUT_RECORD = requires(T a) {
} // namespace detail

template <typename T>
concept RECORD_TYPE = detail::BASE_RECORD<T> && (detail::INPUT_RECORD<T> || detail::OUTPUT_RECORD<T>);
concept RECORD_TYPE = detail::BASE_RECORD<T> &&(detail::INPUT_RECORD<T> || detail::OUTPUT_RECORD<T>);

template <typename T>
concept NUMERIC_TYPE = std::same_as<T, epicsInt32> || std::same_as<T, epicsUInt32> || std::same_as<T, epicsInt16> ||
Expand Down

0 comments on commit 80d243a

Please sign in to comment.