-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
chore: Check copyright and license as one joined substring #8815
Conversation
scripts/checkCopyrightHeaders.js
Outdated
' *', | ||
' * This source code is licensed under the MIT license found in the', | ||
' * LICENSE file in the root directory of this source tree.', | ||
].join('\n'); | ||
|
||
function needsCopyrightHeader(file) { | ||
const contents = getFileContents(file); | ||
|
||
// Match lines individually to avoid false positive for: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pedrottimark Yes the line endings now shouldn't be a problem as they're required to be LF. But this comment says another reason why lines are checked individually is the ability to use line comments instead of a block comment. Looks like this possibility is never used (CI is green) but wondering if these line substrings are the standard license header check for FB or something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry to make you do the proof reading that I should have done, because I wrote that comment in the previous PR and that sentence was a step in the wrong direction.
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
What do y’all think? In the first draft of #8783 a joined substring found some mistakes:
All rights reserved.
line between copyright and licensecheckCopyrightHeaders.js
itself ;)that searching for the 3 lines independently (in the merged code) does not find
Test plan
yarn check-copyright-headers
After #8809 the script will pass when run locally on Windows system, correct?
Tim, thanks again for researching such a smart solution ❤️