Skip to content

Add license header check#1293

Open
jiannanWang wants to merge 6 commits intopytorch:mainfrom
jiannanWang:license
Open

Add license header check#1293
jiannanWang wants to merge 6 commits intopytorch:mainfrom
jiannanWang:license

Conversation

@jiannanWang
Copy link
Copy Markdown
Contributor

Add license header checker to check for license. Two license header styles: C style (for .cpp, .h, .cu, and .cuh files) and hash style (for .py, .sh files)

C_STYLE_HEADER = """\
/*
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 * All rights reserved.
 *
 * This source code is licensed under the BSD-style license found in the
 * LICENSE file in the root directory of this source tree.
 */"""

HASH_STYLE_HEADER = """\
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree."""

Running the checker in current repo and found the following files missing license header:

Missing license headers in the following files:
  - ./libkineto/src/plugin/aiupti/AiuptiActivityApi.cpp
  - ./libkineto/src/plugin/aiupti/AiuptiActivityApi.h
  - ./libkineto/src/plugin/aiupti/AiuptiActivityBuffer.h
  - ./libkineto/src/plugin/aiupti/AiuptiActivityHandlers.cpp
  - ./libkineto/src/plugin/aiupti/AiuptiActivityProfiler.cpp
  - ./libkineto/src/plugin/aiupti/AiuptiActivityProfiler.h
  - ./libkineto/src/plugin/aiupti/AiuptiProfilerMacros.h
  - ./libkineto/test/xpupti/compute/XpuptiScopeProfilerCompute.cpp
  - ./tools/linter/adapters/clangformat_linter.py
  - ./tools/linter/adapters/grep_linter.py
  - ./tools/linter/adapters/newlines_linter.py
  - ./tools/linter/install/clangformat.py

@meta-cla meta-cla Bot added the cla signed label Mar 10, 2026
@jiannanWang jiannanWang marked this pull request as ready for review April 20, 2026 19:03
@meta-codesync
Copy link
Copy Markdown

meta-codesync Bot commented Apr 20, 2026

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

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.

1 participant