diff --git a/.lintrunner.toml b/.lintrunner.toml index 66e720134249..5afee4d0ae9c 100644 --- a/.lintrunner.toml +++ b/.lintrunner.toml @@ -818,3 +818,21 @@ init_command = [ 'usort==1.0.2', ] is_formatter = true + +[[linter]] +code = 'COPYRIGHT' +include_patterns = ['**'] +exclude_patterns = ['.lintrunner.toml'] +command = [ + 'python3', + 'tools/linter/adapters/grep_linter.py', + '--pattern=Confidential and proprietary', + '--linter-name=COPYRIGHT', + '--error-name=Confidential Code', + """--error-description=\ + Proprietary and confidential source code\ + should not be contributed to PyTorch codebase\ + """, + '--', + '@{{PATHSFILE}}' +] diff --git a/android/pytorch_android/src/androidTest/cpp/pytorch_jni_common_test.cpp b/android/pytorch_android/src/androidTest/cpp/pytorch_jni_common_test.cpp index 9caf4e1c2a58..eab3d8d1c8eb 100644 --- a/android/pytorch_android/src/androidTest/cpp/pytorch_jni_common_test.cpp +++ b/android/pytorch_android/src/androidTest/cpp/pytorch_jni_common_test.cpp @@ -1,4 +1,7 @@ -// (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary. +// Copyright (c) Meta Platforms, Inc. and affiliates. +// +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. #include diff --git a/aten/src/ATen/native/metal/mpscnn/tests/MetalOpTestRunner.h b/aten/src/ATen/native/metal/mpscnn/tests/MetalOpTestRunner.h index 0178b24c75fe..d50ad24a09e4 100644 --- a/aten/src/ATen/native/metal/mpscnn/tests/MetalOpTestRunner.h +++ b/aten/src/ATen/native/metal/mpscnn/tests/MetalOpTestRunner.h @@ -1,4 +1,7 @@ -// (c) Facebook, Inc. and its affiliates. Confidential and proprietary. +// Copyright (c) Meta Platforms, Inc. and affiliates. +// +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. #import #include diff --git a/aten/src/ATen/native/metal/mpscnn/tests/MetalOpTestRunner.mm b/aten/src/ATen/native/metal/mpscnn/tests/MetalOpTestRunner.mm index 5932240df2e1..cbf53baf680a 100644 --- a/aten/src/ATen/native/metal/mpscnn/tests/MetalOpTestRunner.mm +++ b/aten/src/ATen/native/metal/mpscnn/tests/MetalOpTestRunner.mm @@ -1,4 +1,7 @@ -// (c) Facebook, Inc. and its affiliates. Confidential and proprietary. +// Copyright (c) Meta Platforms, Inc. and affiliates. +// +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. #import "MetalOpTestRunner.h" diff --git a/benchmarks/static_runtime/test_utils.cc b/benchmarks/static_runtime/test_utils.cc index cc8880113933..59699c42fea1 100644 --- a/benchmarks/static_runtime/test_utils.cc +++ b/benchmarks/static_runtime/test_utils.cc @@ -1,4 +1,7 @@ -// (c) Facebook, Inc. and its affiliates. Confidential and proprietary. +// Copyright (c) Meta Platforms, Inc. and affiliates. +// +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. #include "test_utils.h" diff --git a/benchmarks/static_runtime/test_utils.h b/benchmarks/static_runtime/test_utils.h index 27efd4d7d42e..c5d75b3d80c6 100644 --- a/benchmarks/static_runtime/test_utils.h +++ b/benchmarks/static_runtime/test_utils.h @@ -1,4 +1,7 @@ -// (c) Facebook, Inc. and its affiliates. Confidential and proprietary. +// Copyright (c) Meta Platforms, Inc. and affiliates. +// +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. #pragma once diff --git a/caffe2/utils/knob_patcher.cc b/caffe2/utils/knob_patcher.cc index 31ff0f138854..e099ea61dd87 100644 --- a/caffe2/utils/knob_patcher.cc +++ b/caffe2/utils/knob_patcher.cc @@ -1,4 +1,7 @@ -// (c) Facebook, Inc. and its affiliates. Confidential and proprietary. +// Copyright (c) Meta Platforms, Inc. and its affiliates. +// +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. #include diff --git a/caffe2/utils/knobs.cc b/caffe2/utils/knobs.cc index 7d9438a48aa5..63941a573edf 100644 --- a/caffe2/utils/knobs.cc +++ b/caffe2/utils/knobs.cc @@ -1,5 +1,5 @@ -// (c) Facebook, Inc. and its affiliates. Confidential and proprietary. - +// Copyright (c) Meta Platforms, Inc. and affiliates. +// // This is a very basic knob implementation that purely uses command line flags. // This can be replaced with a more sophisticated implementation for use in // other production environments. diff --git a/torch/csrc/distributed/c10d/ParamCommsUtils.cpp b/torch/csrc/distributed/c10d/ParamCommsUtils.cpp index 5f327182e36c..5f566fb24784 100644 --- a/torch/csrc/distributed/c10d/ParamCommsUtils.cpp +++ b/torch/csrc/distributed/c10d/ParamCommsUtils.cpp @@ -1,4 +1,7 @@ -// (c) Facebook, Inc. and its affiliates. Confidential and proprietary. +// Copyright (c) Meta Platforms, Inc. and affiliates. +// +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. #include diff --git a/torch/csrc/distributed/c10d/quantization/quantization.h b/torch/csrc/distributed/c10d/quantization/quantization.h index 739991b92505..8cf3455ce79b 100644 --- a/torch/csrc/distributed/c10d/quantization/quantization.h +++ b/torch/csrc/distributed/c10d/quantization/quantization.h @@ -1,4 +1,7 @@ -// (c) Facebook, Inc. and its affiliates. Confidential and proprietary. +// Copyright (c) Meta Platforms, Inc. and affiliates. +// +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. #pragma once diff --git a/torch/csrc/distributed/c10d/quantization/quantization_gpu.h b/torch/csrc/distributed/c10d/quantization/quantization_gpu.h index c10ffd4c6a39..90bfc083b39d 100644 --- a/torch/csrc/distributed/c10d/quantization/quantization_gpu.h +++ b/torch/csrc/distributed/c10d/quantization/quantization_gpu.h @@ -1,4 +1,7 @@ -// (c) Facebook, Inc. and its affiliates. Confidential and proprietary. +// Copyright (c) Meta Platforms, Inc. and affiliates. +// +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. #pragma once diff --git a/torch/csrc/distributed/c10d/quantization/quantization_utils.h b/torch/csrc/distributed/c10d/quantization/quantization_utils.h index add49c84ace2..603e24194418 100644 --- a/torch/csrc/distributed/c10d/quantization/quantization_utils.h +++ b/torch/csrc/distributed/c10d/quantization/quantization_utils.h @@ -1,4 +1,7 @@ -// (c) Facebook, Inc. and its affiliates. Confidential and proprietary. +// Copyright (c) Meta Platforms, Inc. and affiliates. +// +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. #pragma once diff --git a/torch/csrc/jit/backends/coreml/cpp/preprocess.cpp b/torch/csrc/jit/backends/coreml/cpp/preprocess.cpp index b124e5479889..80e7315b76c4 100644 --- a/torch/csrc/jit/backends/coreml/cpp/preprocess.cpp +++ b/torch/csrc/jit/backends/coreml/cpp/preprocess.cpp @@ -1,4 +1,8 @@ -// (c) Facebook, Inc. and its affiliates. Confidential and proprietary. +// Copyright (c) Meta Platforms, Inc. and affiliates. +// +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. + #include #include #include diff --git a/torch/csrc/jit/backends/xnnpack/compiler/xnn_compiler.cpp b/torch/csrc/jit/backends/xnnpack/compiler/xnn_compiler.cpp index a64bf35431fd..5038a7df16b3 100644 --- a/torch/csrc/jit/backends/xnnpack/compiler/xnn_compiler.cpp +++ b/torch/csrc/jit/backends/xnnpack/compiler/xnn_compiler.cpp @@ -1,4 +1,7 @@ -// (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary. +// Copyright (c) Meta Platforms, Inc. and affiliates. +// +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. #include #include diff --git a/torch/csrc/jit/backends/xnnpack/compiler/xnn_compiler.h b/torch/csrc/jit/backends/xnnpack/compiler/xnn_compiler.h index f74e784111d4..f219f2a9d941 100644 --- a/torch/csrc/jit/backends/xnnpack/compiler/xnn_compiler.h +++ b/torch/csrc/jit/backends/xnnpack/compiler/xnn_compiler.h @@ -1,4 +1,7 @@ -// (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary. +// Copyright (c) Meta Platforms, Inc. and affiliates. +// +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. #include #include diff --git a/torch/csrc/jit/backends/xnnpack/executor/xnn_executor.h b/torch/csrc/jit/backends/xnnpack/executor/xnn_executor.h index 2521c0c7749d..33542d69c80e 100644 --- a/torch/csrc/jit/backends/xnnpack/executor/xnn_executor.h +++ b/torch/csrc/jit/backends/xnnpack/executor/xnn_executor.h @@ -1,4 +1,8 @@ -// (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary. +// Copyright (c) Meta Platforms, Inc. and affiliates. +// +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. + #pragma once #include #include diff --git a/torch/csrc/jit/backends/xnnpack/serialization/serializer.cpp b/torch/csrc/jit/backends/xnnpack/serialization/serializer.cpp index 637f7cdf4c52..c126c1995ffb 100644 --- a/torch/csrc/jit/backends/xnnpack/serialization/serializer.cpp +++ b/torch/csrc/jit/backends/xnnpack/serialization/serializer.cpp @@ -1,4 +1,7 @@ -// (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary. +// Copyright (c) Meta Platforms, Inc. and affiliates. +// +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. #include #include diff --git a/torch/csrc/jit/backends/xnnpack/serialization/serializer.h b/torch/csrc/jit/backends/xnnpack/serialization/serializer.h index 5a683c3dc323..05594983d246 100644 --- a/torch/csrc/jit/backends/xnnpack/serialization/serializer.h +++ b/torch/csrc/jit/backends/xnnpack/serialization/serializer.h @@ -1,4 +1,7 @@ -// (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary. +// Copyright (c) Meta Platforms, Inc. and affiliates. +// +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. #include #include diff --git a/torch/csrc/jit/backends/xnnpack/xnnpack_graph_builder.cpp b/torch/csrc/jit/backends/xnnpack/xnnpack_graph_builder.cpp index 7c7bb2d02e4c..5bdcbe63797c 100644 --- a/torch/csrc/jit/backends/xnnpack/xnnpack_graph_builder.cpp +++ b/torch/csrc/jit/backends/xnnpack/xnnpack_graph_builder.cpp @@ -1,4 +1,7 @@ -// (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary. +// Copyright (c) Meta Platforms, Inc. and affiliates. +// +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. #include #include diff --git a/torch/csrc/jit/backends/xnnpack/xnnpack_graph_builder.h b/torch/csrc/jit/backends/xnnpack/xnnpack_graph_builder.h index 0ef0757f2319..b018b4adbb88 100644 --- a/torch/csrc/jit/backends/xnnpack/xnnpack_graph_builder.h +++ b/torch/csrc/jit/backends/xnnpack/xnnpack_graph_builder.h @@ -1,4 +1,8 @@ -// (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary. +// Copyright (c) Meta Platforms, Inc. and affiliates. +// +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. + #include #include #include