Skip to content

Update format-diff script to add text to new files#14143

Closed
jaykorean wants to merge 2 commits intofacebook:mainfrom
jaykorean:copyright_text_fix
Closed

Update format-diff script to add text to new files#14143
jaykorean wants to merge 2 commits intofacebook:mainfrom
jaykorean:copyright_text_fix

Conversation

@jaykorean
Copy link
Contributor

@jaykorean jaykorean commented Nov 21, 2025

Summary

Fixing internal validator failure

Every project specific source file must contain a doc block with an appropriate copyright header. Unrelated files must be listed as exceptions in the Copyright Headers Exceptions page in the repo dashboard.
A copyright header clearly indicates that the code is owned by Meta. Every open source file must start with a comment containing "Meta Platforms, Inc. and affiliates"
https://github.com/facebook/rocksdb/blob/main/buckifier/targets_cfg.py:
The first 16 lines of 'buckifier/targets_cfg.py' do not contain the patterns:
	(Meta Platforms, Inc. and affiliates)|(Facebook, Inc(\.|,)? and its affiliates)|([0-9]{4}-present(\.|,)? Facebook)|([0-9]{4}(\.|,)? Facebook)

While fixing the text to pass the linter, I took the opportunity to modify format-diff.sh script to add the copyright header automatically if missing in new files.

Test Plan

$> make format

new python file

build_tools/format-diff.sh
Checking format of uncommitted changes...
Checking for copyright headers in new files...
Added copyright header to build_tools/test.py
Copyright headers were added to new files.
Nothing needs to be reformatted!

new header file

build_tools/format-diff.sh
Checking format of uncommitted changes...
Checking for copyright headers in new files...
Added copyright header to db/db_impl/db_impl_jewoongh.h
Copyright headers were added to new files.
Nothing needs to be reformatted!

@meta-cla meta-cla bot added the CLA Signed label Nov 21, 2025
@jaykorean jaykorean changed the title Fix copyright text Update format-diff script to add text to new files Nov 21, 2025
@jaykorean jaykorean marked this pull request as ready for review November 21, 2025 17:30
@meta-codesync
Copy link

meta-codesync bot commented Nov 21, 2025

@jaykorean has imported this pull request. If you are a Meta employee, you can view this in D87653124.

@meta-codesync meta-codesync bot closed this in c4bbad4 Nov 21, 2025
@meta-codesync
Copy link

meta-codesync bot commented Nov 21, 2025

@jaykorean merged this pull request in c4bbad4.

@jaykorean jaykorean deleted the copyright_text_fix branch November 21, 2025 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants