diff --git a/.clang-tidy b/.clang-tidy new file mode 100644 index 000000000..50c4d9633 --- /dev/null +++ b/.clang-tidy @@ -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).*(?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() diff --git a/third_party/tcplp/tcplp.h b/third_party/tcplp/tcplp.h index 891d9d023..426963526 100644 --- a/third_party/tcplp/tcplp.h +++ b/third_party/tcplp/tcplp.h @@ -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,