-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Lint trailing newlines #54737
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
Lint trailing newlines #54737
Conversation
💊 CI failures summary and remediationsAs of commit ef871b6 (more details on the Dr. CI page): ✅ None of the CI failures appear to be your fault 💚
🚧 1 ongoing upstream failure:These were probably caused by upstream breakages that are not fixed yet.
This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.Please report bugs/suggestions to the (internal) Dr. CI Users group. |
Codecov Report
@@ Coverage Diff @@
## master #54737 +/- ##
==========================================
- Coverage 77.45% 77.43% -0.03%
==========================================
Files 1894 1892 -2
Lines 186401 186399 -2
==========================================
- Hits 144377 144329 -48
- Misses 42024 42070 +46 |
|
@samestep has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
|
@samestep has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
Summary: PRs #53652 and #54693 attempted to increase the consistency of our choice of commit (head vs merge) for CI on PRs, and have so far been unsuccessful. This PR takes a less ambitious approach to the problem by clarifying the choice in one specific way (see the following paragraph) and documenting it in `CONTRIBUTING.md`. In addition to documentation, this PR also removes the current behavior of our GHA jobs that checkout the PR tip instead of the merge commit. At first glance, this behavior seems to increase consistency (by eliminating the special-case for `ghstack` PRs), but in reality, it actually just means that for non-`ghstack` PRs, the question "Which commit is used in CI?" has *two* answers instead of just one; see the description of #53652 for more details. Once merged, this PR will unblock other PRs that add modify our GHA workflows in breaking ways, such as #54737. Pull Request resolved: #54967 Test Plan: None. Reviewed By: walterddr, seemethere Differential Revision: D27435913 Pulled By: samestep fbshipit-source-id: 405fb419cf015cf88107d5eb2498cfb5bcb7ce33
|
@samestep has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
**Summary** The `clang-format` reference hashes committed in #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 ##54790. [ghstack-poisoned]
**Summary** The `clang-format` reference hashes committed in #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 ##54790. [ghstack-poisoned]
**Summary** The `clang-format` reference hashes committed in #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 ##54790. ghstack-source-id: f856a00 Pull Request resolved: #55328
…eference hashes" **Summary** The `clang-format` reference hashes committed in #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 #54790. Differential Revision: [D27577398](https://our.internmc.facebook.com/intern/diff/D27577398) [ghstack-poisoned]
**Summary** The `clang-format` reference hashes committed in #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 #54790. Differential Revision: [D27577398](https://our.internmc.facebook.com/intern/diff/D27577398) [ghstack-poisoned]
Pull Request resolved: #55328 **Summary** The `clang-format` reference hashes committed in #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 #54790. Differential Revision: [D27577398](https://our.internmc.facebook.com/intern/diff/D27577398/) ghstack-source-id: 125877245
Summary: Pull Request resolved: #55328 **Summary** The `clang-format` reference hashes committed in #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 #54790. Test Plan: Imported from OSS Reviewed By: nikithamalgifb Differential Revision: D27577398 Pulled By: SplitInfinity fbshipit-source-id: e30bee58c2eb5ea96ed0a503480dea4f67b86aca
Context: #53406 added a lint for trailing whitespace at the ends of lines. However, in order to pass FB-internal lints, that PR also had to normalize the trailing newlines in four of the files it touched. This PR adds an OSS lint to normalize trailing newlines.
The changes to the following files (made in 54847d0) are the only manually-written parts of this PR:
.github/workflows/lint.ymlmypy-strict.initools/README.mdtools/test/test_trailing_newlines.pytools/trailing_newlines.pyI would have liked to make this just a shell one-liner like the other three similar lints, but nothing I could find quite fit the bill. Specifically, all the answers I tried from the following Stack Overflow questions were far too slow (at least a minute and a half to run on this entire repository):
To avoid giving false positives during the few days after this PR is merged, we should probably only merge it after #54967.
Test plan:
Running the shell script from the "Ensure correct trailing newlines" step in the
quick-checksjob of.github/workflows/lint.ymlshould print no output and exit in a fraction of a second with a status of 0. That was not the case prior to this PR, as shown by this failing GHA workflow run on an earlier draft of this PR:In contrast, this run (after correcting the trailing newlines in this PR) succeeded:
To unit-test
tools/trailing_newlines.pyitself (this is run as part of our "Test tools" GitHub Actions workflow):