Skip to content

Add license header check#1293

Draft
jiannanWang wants to merge 4 commits intopytorch:mainfrom
jiannanWang:license
Draft

Add license header check#1293
jiannanWang wants to merge 4 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
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