Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FORMAT] Do not format .diff and .patch #10

Merged
merged 3 commits into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ Increment the:

## [Unreleased]

* TITLE
* [FORMAT] Do not format .diff and .patch
[#10](https://github.com/open-telemetry/cpp-build-tools/pull/10)

## [0.0] 2024-02-16

Expand Down
6 changes: 3 additions & 3 deletions cpp_format_tools/format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ fi
# No CRLF line endings, except Windows files.
"${SED[@]}" 's/\r$//' $($FIND -name '*.ps1' -prune -o \
-name '*.cmd' -prune -o -type f -print)
# No trailing spaces.
"${SED[@]}" 's/ \+$//' $($FIND -type f -print)
# No trailing spaces, except in diff or patch.
"${SED[@]}" 's/ \+$//' $($FIND -name "*.diff" -prune -o -name "*.patch" -prune -o -type f -print)

# If not overridden, try to use clang-format-18 or clang-format.
if [[ -z "$CLANG_FORMAT" ]]; then
Expand Down Expand Up @@ -56,4 +56,4 @@ else
echo "Can't find buildifier. It can be installed with:"
echo " go get github.com/bazelbuild/buildtools/buildifier"
exit 1
fi
fi