Skip to content
This repository has been archived by the owner on Aug 16, 2024. It is now read-only.

Commit

Permalink
[tools] Remove newline from clang-format reference hashes (pytorch#55328
Browse files Browse the repository at this point in the history
)

Summary:
Pull Request resolved: pytorch#55328

**Summary**
The `clang-format` reference hashes committed in pytorch#54737 have newlines at
the end but the locally computed ones do not. This commit removes these
newlines so that the `clang-format` binary verification step doesn't
fail.

**Test Plan**
`./tools/clang_format_all.py`, ran successfully.

**Fixes**
This commit fixes pytorch#54790.

Test Plan: Imported from OSS

Reviewed By: nikithamalgifb

Differential Revision: D27577398

Pulled By: SplitInfinity

fbshipit-source-id: e30bee58c2eb5ea96ed0a503480dea4f67b86aca
  • Loading branch information
Meghan Lele authored and facebook-github-bot committed Apr 7, 2021
1 parent 96655e2 commit 34a7b4a
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
.jenkins/run-shellcheck.sh
- name: Ensure correct trailing newlines
run: |
(! git grep -Il '' -- . ':(exclude)**/contrib/**' ':(exclude)third_party' ':(exclude)**.expect' | tools/trailing_newlines.py || (echo "The above files do not have correct trailing newlines; please normalize them"; false))
(! git grep -Il '' -- . ':(exclude)**/contrib/**' ':(exclude)third_party' ':(exclude)**.expect' ':(exclude)tools/clang_format_hash' | tools/trailing_newlines.py || (echo "The above files do not have correct trailing newlines; please normalize them"; false))
- name: Ensure no trailing spaces
run: |
(! git grep -I -no ' $' -- . ':(exclude)**/contrib/**' ':(exclude)third_party' || (echo "The above files have trailing spaces; please remove them"; false))
Expand Down
2 changes: 1 addition & 1 deletion tools/clang_format_hash/linux64/clang-format-linux64
Original file line number Diff line number Diff line change
@@ -1 +1 @@
21ca53c291a88b53dac85751b7a0203ca610ac94b7adaff3c092cf30df4168f2
21ca53c291a88b53dac85751b7a0203ca610ac94b7adaff3c092cf30df4168f2
2 changes: 1 addition & 1 deletion tools/clang_format_hash/mac/clang-format-mojave
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5fde7bccf65032da297dfb1f18e4a95e96e278fa397e9dcaf364dfe23ec46353
5fde7bccf65032da297dfb1f18e4a95e96e278fa397e9dcaf364dfe23ec46353
1 change: 1 addition & 0 deletions tools/clang_format_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ def get_and_check_clang_format(verbose=False):
# Err on the side of caution and try to delete the downloaded binary.
try:
os.unlink(CLANG_FORMAT_PATH)
print("The binary has been deleted just to be safe")
except OSError as e:
print("Failed to delete binary: {}".format(str(e)))
print("Delete this binary as soon as possible and do not execute it!")
Expand Down

0 comments on commit 34a7b4a

Please sign in to comment.