Skip to content

Commit

Permalink
WTF
Browse files Browse the repository at this point in the history
  • Loading branch information
CuriousGeorgiy committed Jan 10, 2024
1 parent 9f76acb commit b0dd043
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .githooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ set -eu -o pipefail
# Redirect output to stderr.
exec 1>&2

if [[ $(git clang-format --diff --staged) != "" ]]; then
output=$(git clang-format --diff --staged)
if [[ $output != "" && $output != "no modified files to format" ]]; then
echo Code formatting changed some files, please review.
exit 1
fi
4 changes: 3 additions & 1 deletion .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ jobs:
- name: Run clang-format
# Run clang-format on commits off the base branch of the pull request.
run: >
if git clang-format origin/${{ github.event.pull_request.base.ref }} --diff; then
output=$(git clang-format origin/${{ github.event.pull_request.base.ref }} --diff 2>&1)
if [[ $output != "" && $output != "no modified files to format" ]]; then
echo Code formatting changed some files, please review.
exit 1
fi
Expand Down
3 changes: 2 additions & 1 deletion src/Client/Connector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,8 @@ Connector<BUFFER, NetProvider>::wait(Connection<BUFFER, NetProvider> &conn,
m_ReadyToDecode.erase(conn);
}
}
if (conn.hasError()) {
if (conn.hasError())
{
LOG_ERROR("Connection got an error: ", conn.getError().msg);
return -1;
}
Expand Down

0 comments on commit b0dd043

Please sign in to comment.