mirror of
https://github.com/espressif/openthread.git
synced 2026-06-05 21:14:49 +00:00
[clang-tidy] move config to .clang-tidy file (#9308)
This commit is contained in:
+22
@@ -0,0 +1,22 @@
|
||||
---
|
||||
Checks: >
|
||||
-*,
|
||||
bugprone-argument-comment,
|
||||
google-explicit-constructor,
|
||||
google-readability-casting,
|
||||
misc-unused-using-decls,
|
||||
modernize-loop-convert,
|
||||
modernize-use-bool-literals,
|
||||
modernize-use-equals-default,
|
||||
modernize-use-equals-delete,
|
||||
modernize-use-nullptr,
|
||||
readability-avoid-const-params-in-decls,
|
||||
readability-else-after-return,
|
||||
readability-inconsistent-declaration-parameter-name,
|
||||
readability-make-member-function-const,
|
||||
readability-redundant-control-flow,
|
||||
readability-redundant-member-init,
|
||||
readability-simplify-boolean-expr,
|
||||
readability-static-accessed-through-instance
|
||||
WarningsAsErrors: '*'
|
||||
HeaderFilterRegex: '(examples|include|src).*(?<!third_party.*repo)'
|
||||
+5
-35
@@ -142,27 +142,6 @@ OT_CLANG_TIDY_BUILD_OPTS=(
|
||||
)
|
||||
readonly OT_CLANG_TIDY_BUILD_OPTS
|
||||
|
||||
OT_CLANG_TIDY_CHECKS="\
|
||||
-*,\
|
||||
google-explicit-constructor,\
|
||||
google-readability-casting,\
|
||||
misc-unused-using-decls,\
|
||||
modernize-loop-convert,\
|
||||
modernize-use-bool-literals,\
|
||||
modernize-use-equals-default,\
|
||||
modernize-use-equals-delete,\
|
||||
modernize-use-nullptr,\
|
||||
readability-avoid-const-params-in-decls,\
|
||||
readability-else-after-return,\
|
||||
readability-inconsistent-declaration-parameter-name,\
|
||||
readability-make-member-function-const,\
|
||||
readability-redundant-control-flow,\
|
||||
readability-redundant-member-init,\
|
||||
readability-simplify-boolean-expr,\
|
||||
readability-static-accessed-through-instance,\
|
||||
"
|
||||
readonly OT_CLANG_TIDY_CHECKS
|
||||
|
||||
do_clang_format()
|
||||
{
|
||||
echo -e '========================================'
|
||||
@@ -192,7 +171,7 @@ do_clang_tidy_fix()
|
||||
(mkdir -p ./build/cmake-tidy \
|
||||
&& cd ./build/cmake-tidy \
|
||||
&& THREAD_VERSION=1.3 cmake "${OT_CLANG_TIDY_BUILD_OPTS[@]}" ../.. \
|
||||
&& ../../script/clang-tidy -header-filter='.*' -checks="${OT_CLANG_TIDY_CHECKS}" -j"$OT_BUILD_JOBS" "${OT_CLANG_TIDY_FIX_DIRS[@]}" -fix)
|
||||
&& ../../script/clang-tidy -j"$OT_BUILD_JOBS" "${OT_CLANG_TIDY_FIX_DIRS[@]}" -fix)
|
||||
}
|
||||
|
||||
do_clang_tidy_check()
|
||||
@@ -201,19 +180,10 @@ do_clang_tidy_check()
|
||||
echo -e ' check c/c++ (clang-tidy)'
|
||||
echo -e '========================================'
|
||||
|
||||
(
|
||||
mkdir -p ./build/cmake-tidy \
|
||||
&& cd ./build/cmake-tidy \
|
||||
&& THREAD_VERSION=1.3 cmake "${OT_CLANG_TIDY_BUILD_OPTS[@]}" ../.. \
|
||||
&& ../../script/clang-tidy -header-filter='.*' -checks="${OT_CLANG_TIDY_CHECKS}" -j"$OT_BUILD_JOBS" "${OT_CLANG_TIDY_FIX_DIRS[@]}" \
|
||||
| grep -v -E "third_party" >output.txt
|
||||
if grep -q "warning: \|error: " output.txt; then
|
||||
echo "You must pass the clang tidy checks before submitting a pull request"
|
||||
echo ""
|
||||
grep --color -E 'warning: |error: ' -A 5 output.txt
|
||||
exit 1
|
||||
fi
|
||||
)
|
||||
(mkdir -p ./build/cmake-tidy \
|
||||
&& cd ./build/cmake-tidy \
|
||||
&& THREAD_VERSION=1.3 cmake "${OT_CLANG_TIDY_BUILD_OPTS[@]}" ../.. \
|
||||
&& ../../script/clang-tidy -j"$OT_BUILD_JOBS" "${OT_CLANG_TIDY_FIX_DIRS[@]}")
|
||||
}
|
||||
|
||||
do_markdown_format()
|
||||
|
||||
Vendored
+14
-14
@@ -66,22 +66,22 @@ struct tcplp_signals
|
||||
* Functions that the TCP protocol logic can call to interact with the rest of
|
||||
* the system.
|
||||
*/
|
||||
otMessage * tcplp_sys_new_message(otInstance *instance);
|
||||
void tcplp_sys_free_message(otInstance *instance, otMessage *pkt);
|
||||
void tcplp_sys_send_message(otInstance *instance, otMessage *pkt, otMessageInfo *info);
|
||||
otMessage * tcplp_sys_new_message(otInstance *aInstance);
|
||||
void tcplp_sys_free_message(otInstance *aInstance, otMessage *aMessage);
|
||||
void tcplp_sys_send_message(otInstance *aInstance, otMessage *aMessage, otMessageInfo *aMessageInfo);
|
||||
uint32_t tcplp_sys_get_ticks();
|
||||
uint32_t tcplp_sys_get_millis();
|
||||
void tcplp_sys_set_timer(struct tcpcb *tcb, uint8_t timer_flag, uint32_t delay);
|
||||
void tcplp_sys_stop_timer(struct tcpcb *tcb, uint8_t timer_flag);
|
||||
struct tcpcb *tcplp_sys_accept_ready(struct tcpcb_listen *tpl, struct in6_addr *addr, uint16_t port);
|
||||
bool tcplp_sys_accepted_connection(struct tcpcb_listen *tpl,
|
||||
struct tcpcb * accepted,
|
||||
struct in6_addr * addr,
|
||||
uint16_t port);
|
||||
void tcplp_sys_connection_lost(struct tcpcb *tcb, uint8_t errnum);
|
||||
void tcplp_sys_on_state_change(struct tcpcb *tcb, int newstate);
|
||||
void tcplp_sys_log(const char *format, ...);
|
||||
void tcplp_sys_panic(const char *format, ...);
|
||||
void tcplp_sys_set_timer(struct tcpcb *aTcb, uint8_t aTimerFlag, uint32_t aDelay);
|
||||
void tcplp_sys_stop_timer(struct tcpcb *aTcb, uint8_t aTimerFlag);
|
||||
struct tcpcb *tcplp_sys_accept_ready(struct tcpcb_listen *aTcbListen, struct in6_addr *aAddr, uint16_t aPort);
|
||||
bool tcplp_sys_accepted_connection(struct tcpcb_listen *aTcbListen,
|
||||
struct tcpcb * aAccepted,
|
||||
struct in6_addr * aAddr,
|
||||
uint16_t aPort);
|
||||
void tcplp_sys_connection_lost(struct tcpcb *aTcb, uint8_t aErrNum);
|
||||
void tcplp_sys_on_state_change(struct tcpcb *aTcb, int aNewState);
|
||||
void tcplp_sys_log(const char *aFormat, ...);
|
||||
void tcplp_sys_panic(const char *aFormat, ...);
|
||||
bool tcplp_sys_autobind(otInstance * aInstance,
|
||||
const otSockAddr *aPeer,
|
||||
otSockAddr * aToBind,
|
||||
|
||||
Reference in New Issue
Block a user