Final update copyright headers to reference license files at the repo root (#1693)

* Final update copyright headers to reference license files at the repo root

Signed-off-by: spham <spham@amazon.com>

* Fix copyright validator unit tests to support the stale O3DE header scenario

Signed-off-by: spham <spham@amazon.com>
This commit is contained in:
Steve Pham
2021-06-30 19:51:55 -07:00
committed by GitHub
parent 7b1c37f296
commit b4a2edec6a
18020 changed files with 18059 additions and 18042 deletions
@@ -1,5 +1,5 @@
#
# Copyright (c) Contributors to the Open 3D Engine Project
# 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.
#
# SPDX-License-Identifier: Apache-2.0 OR MIT
#
@@ -1,5 +1,5 @@
#
# Copyright (c) Contributors to the Open 3D Engine Project
# 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.
#
# SPDX-License-Identifier: Apache-2.0 OR MIT
#
@@ -1,5 +1,5 @@
#
# Copyright (c) Contributors to the Open 3D Engine Project
# 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.
#
# SPDX-License-Identifier: Apache-2.0 OR MIT
#
@@ -1,5 +1,5 @@
#
# Copyright (c) Contributors to the Open 3D Engine Project
# 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.
#
# SPDX-License-Identifier: Apache-2.0 OR MIT
#
@@ -1,5 +1,5 @@
"""
Copyright (c) Contributors to the Open 3D Engine Project
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.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
@@ -1,5 +1,5 @@
#
# Copyright (c) Contributors to the Open 3D Engine Project
# 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.
#
# SPDX-License-Identifier: Apache-2.0 OR MIT
#
@@ -1,5 +1,5 @@
#
# Copyright (c) Contributors to the Open 3D Engine Project
# 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.
#
# SPDX-License-Identifier: Apache-2.0 OR MIT
#
@@ -1,5 +1,5 @@
#
# Copyright (c) Contributors to the Open 3D Engine Project
# 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.
#
# SPDX-License-Identifier: Apache-2.0 OR MIT#
#
@@ -13,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) Contributors to the Open 3D Engine Project, so it should pass\n'))
'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., so it should pass\n'))
def test_fileWithCopyrightHeader_passes(self):
commit = MockCommit(files=['/someCppFile.cpp'])
files = [
'This file does contain\n'
'Copyright (c) Contributors to the Open 3D Engine Project, so it should pass\n',
'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., so it should pass\n',
'This file does contain\n'
'Copyright(c) Contributors to the Open 3D Engine Project, so it should pass\n'
'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., 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) Contributors to the Open 3D Engine Project.',
'// 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.',
]
for file in files:
with patch('builtins.open', mock_open(read_data=file)):
@@ -63,6 +63,14 @@ 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='Copyright (c) Contributors to the Open 3D Engine Project.\n'
'******************\n'.format(' ')))
def test_fileWithStaleO3DECopyrightHeader_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'
'Copyright{0}Crytek\n'.format(' ')))
def test_fileWithCrytekCopyrightHeader_fails(self):
@@ -1,5 +1,5 @@
#
# Copyright (c) Contributors to the Open 3D Engine Project
# 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.
#
# SPDX-License-Identifier: Apache-2.0 OR MIT
#
@@ -1,5 +1,5 @@
#
# Copyright (c) Contributors to the Open 3D Engine Project
# 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.
#
# SPDX-License-Identifier: Apache-2.0 OR MIT
#
@@ -1,5 +1,5 @@
#
# Copyright (c) Contributors to the Open 3D Engine Project
# 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.
#
# SPDX-License-Identifier: Apache-2.0 OR MIT
#
@@ -1,5 +1,5 @@
#
# Copyright (c) Contributors to the Open 3D Engine Project
# 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.
#
# SPDX-License-Identifier: Apache-2.0 OR MIT
#
@@ -1,5 +1,5 @@
#
# Copyright (c) Contributors to the Open 3D Engine Project
# 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.
#
# SPDX-License-Identifier: Apache-2.0 OR MIT
#
@@ -1,5 +1,5 @@
#
# Copyright (c) Contributors to the Open 3D Engine Project
# 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.
#
# SPDX-License-Identifier: Apache-2.0 OR MIT
#
@@ -1,5 +1,5 @@
#
# Copyright (c) Contributors to the Open 3D Engine Project
# 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.
#
# SPDX-License-Identifier: Apache-2.0 OR MIT
#
@@ -1,5 +1,5 @@
#
# Copyright (c) Contributors to the Open 3D Engine Project
# 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.
#
# SPDX-License-Identifier: Apache-2.0 OR MIT
#