O3DE Copyright Updates for Linux Foundation (#1504)
This commit is contained in:
@@ -1,10 +1,6 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
import abc
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
import fnmatch
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
from typing import Dict, List
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
import unittest
|
||||
|
||||
@@ -1,12 +1,6 @@
|
||||
"""
|
||||
|
||||
All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
its licensors.
|
||||
|
||||
For complete copyright and license terms please see the LICENSE at the root of this
|
||||
distribution (the "License"). All use of this software is governed by the License,
|
||||
or, if provided, by the license below or the license accompanying this file. Do not
|
||||
remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
"""
|
||||
Copyright (c) Contributors to the Open 3D Engine Project
|
||||
|
||||
SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
"""
|
||||
|
||||
|
||||
+3
-7
@@ -1,12 +1,8 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
import unittest
|
||||
|
||||
+3
-7
@@ -1,12 +1,8 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
import unittest
|
||||
|
||||
+31
-11
@@ -1,12 +1,7 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT#
|
||||
#
|
||||
|
||||
import unittest
|
||||
@@ -18,19 +13,19 @@ from commit_validation.validators.copyright_header_validator import CopyrightHea
|
||||
|
||||
class CopyrightHeaderValidatorTests(unittest.TestCase):
|
||||
@patch('builtins.open', mock_open(read_data='This file does contain\n'
|
||||
'Copyright (c) Amazon.com, so it should pass\n'))
|
||||
'Copyright (c) Contributors to the Open 3D Engine Project, so it should pass\n'))
|
||||
def test_fileWithCopyrightHeader_passes(self):
|
||||
commit = MockCommit(files=['/someCppFile.cpp'])
|
||||
files = [
|
||||
'This file does contain\n'
|
||||
'Copyright (c) Amazon.com, so it should pass\n',
|
||||
'Copyright (c) Contributors to the Open 3D Engine Project, so it should pass\n',
|
||||
|
||||
'This file does contain\n'
|
||||
'Copyright(c) Amazon.com, so it should pass\n'
|
||||
'Copyright(c) Contributors to the Open 3D Engine Project, so it should pass\n'
|
||||
'and there\'s no space between "Copyright" and "(c)"',
|
||||
|
||||
'This file has a upper-case C between the parenthesis\n'
|
||||
'// Copyright (C) Amazon.com, Inc. or its affiliates.',
|
||||
'// Copyright (C) Contributors to the Open 3D Engine Project.',
|
||||
]
|
||||
for file in files:
|
||||
with patch('builtins.open', mock_open(read_data=file)):
|
||||
@@ -52,6 +47,30 @@ class CopyrightHeaderValidatorTests(unittest.TestCase):
|
||||
self.assertFalse(CopyrightHeaderValidator().run(commit, error_list))
|
||||
self.assertNotEqual(len(error_list), 0, f"Errors were expected but none were returned.")
|
||||
|
||||
@patch('builtins.open', mock_open(read_data='This file does contains legacy header\n'
|
||||
'this{0}file{0}Copyright{0}(c){0}Amazon.com\n'.format(' ')))
|
||||
def test_fileWithLegacyAmazonCopyrightHeader_fails(self):
|
||||
commit = MockCommit(files=['/someCppFile.cpp'])
|
||||
error_list = []
|
||||
self.assertFalse(CopyrightHeaderValidator().run(commit, error_list))
|
||||
self.assertNotEqual(len(error_list), 0, f"Errors were expected but none were returned.")
|
||||
|
||||
@patch('builtins.open', mock_open(read_data='This file does contains legacy header\n'
|
||||
'Modifications{0}copyright{0}Amazon.com,{0}Inc.{0}or{0}its affiliates\n'.format(' ')))
|
||||
def test_fileWithAmazonModificationCopyrightHeader_passes(self):
|
||||
commit = MockCommit(files=['/someCppFile.cpp'])
|
||||
error_list = []
|
||||
self.assertFalse(CopyrightHeaderValidator().run(commit, error_list))
|
||||
self.assertNotEqual(len(error_list), 0, f"Errors were expected but none were returned.")
|
||||
|
||||
@patch('builtins.open', mock_open(read_data='This file does contains legacy header\n'
|
||||
'Copyright{0}Crytek\n'.format(' ')))
|
||||
def test_fileWithCrytekCopyrightHeader_fails(self):
|
||||
commit = MockCommit(files=['/someCppFile.cpp'])
|
||||
error_list = []
|
||||
self.assertFalse(CopyrightHeaderValidator().run(commit, error_list))
|
||||
self.assertNotEqual(len(error_list), 0, f"Errors were expected but none were returned.")
|
||||
|
||||
def test_fileExtensionIgnored_passes(self):
|
||||
commit = MockCommit(files=['/someCppFile.waf_files'])
|
||||
error_list = []
|
||||
@@ -73,3 +92,4 @@ class CopyrightHeaderValidatorTests(unittest.TestCase):
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
||||
|
||||
+3
-7
@@ -1,12 +1,8 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
import unittest
|
||||
|
||||
+3
-7
@@ -1,12 +1,8 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
import unittest
|
||||
|
||||
+3
-7
@@ -1,12 +1,8 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
import unittest
|
||||
|
||||
+3
-7
@@ -1,12 +1,8 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
import unittest
|
||||
|
||||
+3
-7
@@ -1,12 +1,8 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
import unittest
|
||||
|
||||
+3
-7
@@ -1,12 +1,8 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
import unittest
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
import unittest
|
||||
|
||||
+3
-7
@@ -1,12 +1,8 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
import unittest
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
import os
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
import os
|
||||
|
||||
+64
-17
@@ -1,12 +1,7 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT#
|
||||
#
|
||||
|
||||
import fnmatch
|
||||
@@ -16,13 +11,32 @@ from typing import Type, List
|
||||
|
||||
from commit_validation.commit_validation import Commit, CommitValidator, IsFileSkipped, SOURCE_AND_SCRIPT_FILE_EXTENSIONS, EXCLUDED_VALIDATION_PATTERNS, VERBOSE
|
||||
|
||||
OPEN_3D_ENGINE_PATTERN = re.compile(r'copyright[\s]*(?:\(c\))?[\s]*.*?Contributors\sto\sthe\sOpen\s3D\sEngine\sProject', re.IGNORECASE | re.DOTALL)
|
||||
AMAZON_ORIGINAL_COPYRIGHT_PATTERN = re.compile(r'.*?this\sfile\sCopyright\s*\(c\)\s*Amazon\.com.*?', re.IGNORECASE | re.DOTALL)
|
||||
AMAZON_MODIFICATION_COPYRIGHT_PATTERN = re.compile(r'.*?Modifications\scopyright\sAmazon\.com', re.IGNORECASE | re.DOTALL)
|
||||
CRYTEK_COPYRIGHT_PATTERN = re.compile(r'Copyright Crytek', re.MULTILINE)
|
||||
|
||||
EXCLUDED_COPYRIGHT_VALIDATION_PATTERNS = [
|
||||
'*/Code/Framework/AzCore/AzCore/Math/Sha1.h', # Copyright 2007 Andy Tompkins.
|
||||
'*/Code/Framework/AzCore/AzCore/std/string/utf8/core.h', # Copyright 2006 Nemanja Trifunovic
|
||||
'*/Code/Framework/AzCore/AzCore/std/string/utf8/unchecked.h', # Copyright 2006 Nemanja Trifunovic
|
||||
'*/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/Ltc.azsli', # Copyright (c) 2017, Eric Heitz, Jonathan Dupuy, Stephen Hill and David Neubelt.
|
||||
'*/Code/CryEngine/CryCommon/MTPseudoRandom.h', # Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura
|
||||
'*/Code/CryEngine/CryCommon/PNoise3.h', # Copyright(c) Ken Perlin
|
||||
'*/Code/Framework/AzQtComponents/AzQtComponents/Components/FlowLayout.*' # Copyright (C) 2015 The Qt Company Ltd.
|
||||
] + EXCLUDED_VALIDATION_PATTERNS
|
||||
|
||||
THIS_FILE = os.path.normcase(__file__)
|
||||
|
||||
class CopyrightHeaderValidator(CommitValidator):
|
||||
"""A file-level validator that makes sure a file contains the standard copyright header"""
|
||||
|
||||
def run(self, commit: Commit, errors: List[str]) -> bool:
|
||||
for file_name in commit.get_files():
|
||||
for pattern in EXCLUDED_VALIDATION_PATTERNS:
|
||||
if os.path.normcase(file_name) == THIS_FILE:
|
||||
# Skip this validator file
|
||||
continue
|
||||
for pattern in EXCLUDED_COPYRIGHT_VALIDATION_PATTERNS:
|
||||
if fnmatch.fnmatch(file_name, pattern):
|
||||
if VERBOSE: print(f'{file_name}::{self.__class__.__name__} SKIPPED - Validation pattern excluded on path.')
|
||||
break
|
||||
@@ -31,18 +45,51 @@ class CopyrightHeaderValidator(CommitValidator):
|
||||
if VERBOSE: print(f'{file_name}::{self.__class__.__name__} SKIPPED - File excluded based on extension.')
|
||||
continue
|
||||
|
||||
copyright_regex = re.compile(r'copyright[\s]*(?:\(c\))?[\s]*amazon\.com', re.IGNORECASE)
|
||||
has_o3de_pattern = False
|
||||
has_amazon_mod_pattern = False
|
||||
has_crytek_pattern = False
|
||||
has_original_amazon_copyright_pattern = False
|
||||
|
||||
# copyright header validator does not use the diff, as it needs to check the front
|
||||
# of the file for the header.
|
||||
with open(file_name, 'rt', encoding='utf8', errors='replace') as fh:
|
||||
for line in fh:
|
||||
if copyright_regex.search(line):
|
||||
break
|
||||
else:
|
||||
error_message = str(f'{file_name}::{self.__class__.__name__} FAILED - Source file missing copyright headers.')
|
||||
errors.append(error_message)
|
||||
if VERBOSE: print(error_message)
|
||||
|
||||
if OPEN_3D_ENGINE_PATTERN.search(line):
|
||||
has_o3de_pattern = True
|
||||
elif AMAZON_ORIGINAL_COPYRIGHT_PATTERN.search(line):
|
||||
has_original_amazon_copyright_pattern = True
|
||||
elif CRYTEK_COPYRIGHT_PATTERN.search(line):
|
||||
has_crytek_pattern = True
|
||||
elif AMAZON_MODIFICATION_COPYRIGHT_PATTERN.search(line):
|
||||
has_amazon_mod_pattern = True
|
||||
|
||||
if has_original_amazon_copyright_pattern:
|
||||
# Has the original Lumberyard Amazon copyright, has not been updated to the O3DE copyright
|
||||
error_message = str(f'{file_name}::{self.__class__.__name__} FAILED - Source file has legacy Amazon Lumberyard copyright.')
|
||||
if VERBOSE: print(error_message)
|
||||
errors.append(error_message)
|
||||
|
||||
if has_amazon_mod_pattern:
|
||||
# Has the Modifications Amazon notice
|
||||
error_message = str(f'{file_name}::{self.__class__.__name__} FAILED - Source file contains Modifications copyright Amazon.com.')
|
||||
if VERBOSE: print(error_message)
|
||||
errors.append(error_message)
|
||||
|
||||
if not has_o3de_pattern:
|
||||
# Missing the O3DE copyright AND does not have the Amazon Modifications copyright, assuming that this file is missing valid copyrights in general
|
||||
error_message = str(f'{file_name}::{self.__class__.__name__} FAILED - Source file missing O3DE copyright header.')
|
||||
if VERBOSE: print(error_message)
|
||||
errors.append(error_message)
|
||||
|
||||
if has_crytek_pattern:
|
||||
error_message = str(f'{file_name}::{self.__class__.__name__} FAILED - Source file contains legacy CryTek original file copyright. Must be deleted.')
|
||||
if VERBOSE: print(error_message)
|
||||
errors.append(error_message)
|
||||
|
||||
if not has_o3de_pattern and not has_original_amazon_copyright_pattern and not has_crytek_pattern and not has_amazon_mod_pattern:
|
||||
error_message = str(f'{file_name}::{self.__class__.__name__} FAILED - Source file missing any recognized copyrights.')
|
||||
if VERBOSE: print(error_message)
|
||||
errors.append(error_message)
|
||||
|
||||
|
||||
return (not errors)
|
||||
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
import fnmatch
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
import fnmatch
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
import os
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
import fnmatch
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
import fnmatch
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
import fnmatch
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
import fnmatch
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
import fnmatch
|
||||
|
||||
Reference in New Issue
Block a user