fix copyright headers and add a script to check (#635)

This commit is contained in:
Zsolt Dollenstein 2022-02-01 11:13:17 +00:00 committed by GitHub
parent c5b073599d
commit c91655fbba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
53 changed files with 86 additions and 51 deletions

30
check_copyright.sh Executable file
View file

@ -0,0 +1,30 @@
#!/bin/bash
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
set -eu
EXITCODE=0
error() { echo "$1"; EXITCODE=1; }
EXCEPTION_PATTERNS=(
"^native/libcst/tests/fixtures/"
"^libcst/_add_slots\.py$"
"^libcst/tests/test_\(e2e\|fuzz\)\.py$"
"^libcst/_parser/base_parser\.py$"
"^libcst/_parser/parso/utils\.py$"
"^libcst/_parser/parso/pgen2/\(generator\|grammar_parser\)\.py$"
"^libcst/_parser/parso/python/\(py_token\|tokenize\)\.py$"
"^libcst/_parser/parso/tests/test_\(fstring\|tokenize\|utils\)\.py$"
)
while read filename; do \
if ! head -n 16 "$filename" | grep -q "Copyright (c) Meta Platforms, Inc. and affiliates."; then
error "Missing copyright in $filename"
fi
done < <( git ls-tree -r --name-only HEAD | grep "\(.py\|\.sh\|\.rs\)$" | \
grep -v "${EXCEPTION_PATTERNS[@]/#/-e}" )
exit $EXITCODE

View file

@ -1,4 +1,4 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

View file

@ -1,4 +1,4 @@
# Copyright (c) Meta Platforms, Inc. and its affiliates.
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

View file

@ -1,4 +1,4 @@
# Copyright (c) Meta Platforms, Inc. and its affiliates.
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

View file

@ -1,4 +1,4 @@
# Copyright (c) Meta Platforms, Inc. and its affiliates.
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

View file

@ -1,4 +1,4 @@
# Copyright (c) Meta Platforms, Inc. and its affiliates.
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

View file

@ -1,4 +1,4 @@
# Copyright (c) Meta Platforms, Inc. and its affiliates.
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

View file

@ -1,4 +1,4 @@
# Copyright (c) 2016-present, Meta Platforms, Inc.
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree

View file

@ -1,4 +1,4 @@
# Copyright (c) 2016-present, Meta Platforms, Inc.
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

View file

@ -1,4 +1,4 @@
# Copyright (c) Meta Platforms, Inc. and its affiliates.
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

View file

@ -1,4 +1,4 @@
// Copyright (c) Meta Platforms, Inc. and its affiliates.
// Copyright (c) Meta Platforms, Inc. and affiliates.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree

View file

@ -1,4 +1,4 @@
// Copyright (c) Meta Platforms, Inc. and its affiliates.
// Copyright (c) Meta Platforms, Inc. and affiliates.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree

View file

@ -1,4 +1,4 @@
// Copyright (c) Meta Platforms, Inc. and its affiliates.
// Copyright (c) Meta Platforms, Inc. and affiliates.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.

View file

@ -1,4 +1,4 @@
// Copyright (c) Meta Platforms, Inc. and its affiliates.
// Copyright (c) Meta Platforms, Inc. and affiliates.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.

View file

@ -1,4 +1,4 @@
// Copyright (c) Meta Platforms, Inc. and its affiliates.
// Copyright (c) Meta Platforms, Inc. and affiliates.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.

View file

@ -1,4 +1,4 @@
// Copyright (c) Meta Platforms, Inc. and its affiliates.
// Copyright (c) Meta Platforms, Inc. and affiliates.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree

View file

@ -1,4 +1,4 @@
// Copyright (c) Meta Platforms, Inc. and its affiliates.
// Copyright (c) Meta Platforms, Inc. and affiliates.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.

View file

@ -1,4 +1,4 @@
// Copyright (c) Meta Platforms, Inc. and its affiliates.
// Copyright (c) Meta Platforms, Inc. and affiliates.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree

View file

@ -1,4 +1,4 @@
// Copyright (c) Meta Platforms, Inc. and its affiliates.
// Copyright (c) Meta Platforms, Inc. and affiliates.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.

View file

@ -1,4 +1,4 @@
// Copyright (c) Meta Platforms, Inc. and its affiliates.
// Copyright (c) Meta Platforms, Inc. and affiliates.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.

View file

@ -1,4 +1,4 @@
// Copyright (c) Meta Platforms, Inc. and its affiliates.
// Copyright (c) Meta Platforms, Inc. and affiliates.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.

View file

@ -1,4 +1,4 @@
// Copyright (c) Meta Platforms, Inc. and its affiliates.
// Copyright (c) Meta Platforms, Inc. and affiliates.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.

View file

@ -1,4 +1,4 @@
// Copyright (c) Meta Platforms, Inc. and its affiliates.
// Copyright (c) Meta Platforms, Inc. and affiliates.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.

View file

@ -1,4 +1,4 @@
// Copyright (c) Meta Platforms, Inc. and its affiliates.
// Copyright (c) Meta Platforms, Inc. and affiliates.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.

View file

@ -1,4 +1,4 @@
// Copyright (c) Meta Platforms, Inc. and its affiliates.
// Copyright (c) Meta Platforms, Inc. and affiliates.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree

View file

@ -1,4 +1,4 @@
// Copyright (c) Meta Platforms, Inc. and its affiliates.
// Copyright (c) Meta Platforms, Inc. and affiliates.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.

View file

@ -1,4 +1,4 @@
// Copyright (c) Meta Platforms, Inc. and its affiliates.
// Copyright (c) Meta Platforms, Inc. and affiliates.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree

View file

@ -1,4 +1,4 @@
// Copyright (c) Meta Platforms, Inc. and its affiliates.
// Copyright (c) Meta Platforms, Inc. and affiliates.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.

View file

@ -1,4 +1,4 @@
// Copyright (c) Meta Platforms, Inc. and its affiliates.
// Copyright (c) Meta Platforms, Inc. and affiliates.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree

View file

@ -1,4 +1,4 @@
// Copyright (c) Meta Platforms, Inc. and its affiliates.
// Copyright (c) Meta Platforms, Inc. and affiliates.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree

View file

@ -1,4 +1,4 @@
// Copyright (c) Meta Platforms, Inc. and its affiliates.
// Copyright (c) Meta Platforms, Inc. and affiliates.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree

View file

@ -1,4 +1,4 @@
// This implementation is Copyright (c) Meta Platforms, Inc. and its affiliates.
// This implementation is Copyright (c) Meta Platforms, Inc. and affiliates.
//
// CPython 3.10.0a5 and the original C code this is based on is
// Copyright (c) 2001-2021 Python Software Foundation; All Rights Reserved

View file

@ -1,4 +1,4 @@
// This implementation is Copyright (c) Meta Platforms, Inc. and its affiliates.
// This implementation is Copyright (c) Meta Platforms, Inc. and affiliates.
//
// CPython 3.10.0a5 and the original C code this is based on is
// Copyright (c) 2001-2021 Python Software Foundation; All Rights Reserved

View file

@ -1,4 +1,4 @@
// Copyright (c) Meta Platforms, Inc. and its affiliates.
// Copyright (c) Meta Platforms, Inc. and affiliates.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.

View file

@ -1,4 +1,4 @@
// Copyright (c) Meta Platforms, Inc. and its affiliates.
// Copyright (c) Meta Platforms, Inc. and affiliates.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.

View file

@ -1,4 +1,4 @@
// Copyright (c) Meta Platforms, Inc. and its affiliates.
// Copyright (c) Meta Platforms, Inc. and affiliates.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.

View file

@ -1,4 +1,4 @@
// Copyright (c) Meta Platforms, Inc. and its affiliates.
// Copyright (c) Meta Platforms, Inc. and affiliates.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.

View file

@ -1,4 +1,4 @@
// Copyright (c) Meta Platforms, Inc. and its affiliates.
// Copyright (c) Meta Platforms, Inc. and affiliates.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.

View file

@ -1,4 +1,4 @@
// Copyright (c) Meta Platforms, Inc. and its affiliates.
// Copyright (c) Meta Platforms, Inc. and affiliates.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.

View file

@ -1,4 +1,4 @@
// Copyright (c) Meta Platforms, Inc. and its affiliates.
// Copyright (c) Meta Platforms, Inc. and affiliates.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree

View file

@ -1,4 +1,4 @@
// Copyright (c) Meta Platforms, Inc. and its affiliates.
// Copyright (c) Meta Platforms, Inc. and affiliates.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree

View file

@ -1,4 +1,4 @@
// Copyright (c) Meta Platforms, Inc. and its affiliates.
// Copyright (c) Meta Platforms, Inc. and affiliates.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree

View file

@ -1,4 +1,4 @@
// Copyright (c) Meta Platforms, Inc. and its affiliates.
// Copyright (c) Meta Platforms, Inc. and affiliates.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree

View file

@ -1,4 +1,4 @@
// Copyright (c) Meta Platforms, Inc. and its affiliates.
// Copyright (c) Meta Platforms, Inc. and affiliates.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree

View file

@ -1,4 +1,4 @@
// Copyright (c) Meta Platforms, Inc. and its affiliates.
// Copyright (c) Meta Platforms, Inc. and affiliates.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree

View file

@ -1,4 +1,4 @@
// Copyright (c) Meta Platforms, Inc. and its affiliates.
// Copyright (c) Meta Platforms, Inc. and affiliates.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree

View file

@ -1,5 +1,10 @@
#!/bin/bash
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
PARSE=$(dirname $0)/target/release/parse
exec diff -u "$1" <($PARSE < "$1")

View file

@ -1,4 +1,4 @@
# Copyright (c) Meta Platforms, Inc. and its affiliates.
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

View file

@ -1,4 +1,4 @@
# Copyright (c) Meta Platforms, Inc. and its affiliates.
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

View file

@ -1,4 +1,4 @@
# Copyright (c) Meta Platforms, Inc. and its affiliates.
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

View file

@ -1,4 +1,4 @@
# Copyright (c) Meta Platforms, Inc. and its affiliates.
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

View file

@ -1,4 +1,4 @@
# Copyright (c) Meta Platforms, Inc. and its affiliates.
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

View file

@ -1,4 +1,4 @@
# Copyright (c) Meta Platforms, Inc. and its affiliates.
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.