Skip to content

Commit abf8b23

Browse files
committed
MQE-431: Automatically check for copyright at the top of every framework file
- Add copyright-check, a bash script to check for the Magento copyright in all tracked files - Fix various missing or incorrect copyrights
1 parent 62bdb57 commit abf8b23

File tree

27 files changed

+132
-12
lines changed

27 files changed

+132
-12
lines changed

bin/copyright-check

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/bash
2+
3+
IGNORE_PATH='bin/copyright-ignore.txt'
4+
FILE_EXTENSIONS_TO_CHECK='.php\|.xml\|.xsd'
5+
6+
RESULT=''
7+
8+
# Iterate through all php, xml, and xsd files that are part of the Git repo
9+
# (excluding any matching lines from the ignore file)
10+
for i in `git ls-tree --full-tree -r --name-only HEAD | grep $FILE_EXTENSIONS_TO_CHECK | grep -v -f $IGNORE_PATH`
11+
do
12+
if echo `cat $i` | grep -q -v "Copyright © Magento, Inc. All rights reserved."; then
13+
# Copyright is missing
14+
RESULT+="$i\n"
15+
fi
16+
done
17+
18+
if [[ ! -z $RESULT ]]; then
19+
printf "\nTHE FOLLOWING FILES ARE MISSING THE MAGENTO COPYRIGHT:\n\n"
20+
printf " Copyright © Magento, Inc. All rights reserved.\n"
21+
printf " See COPYING.txt for license details.\n\n"
22+
printf "$RESULT\n"
23+
exit 1
24+
fi
25+
26+
# Success!
27+
exit 0

bin/copyright-ignore.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dev/tests/static/Magento/Sniffs/Annotations/

src/Magento/FunctionalTestingFramework/Code/Reader/ClassReaderInterface.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?php
22
/**
3-
*
4-
* Copyright © 2013-2017 Magento, Inc. All rights reserved.
3+
* Copyright © Magento, Inc. All rights reserved.
54
* See COPYING.txt for license details.
65
*/
76

src/Magento/FunctionalTestingFramework/Config/Converter/Dom/Flat.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* Copyright © 2013-2017 Magento, Inc. All rights reserved.
3+
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
66
namespace Magento\FunctionalTestingFramework\Config\Converter\Dom;

src/Magento/FunctionalTestingFramework/Config/FileResolver/Mask.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* Copyright © 2017 Magento. All rights reserved.
3+
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
66

src/Magento/FunctionalTestingFramework/Data/Argument/Interpreter/ArrayType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* Copyright © 2013-2017 Magento, Inc. All rights reserved.
3+
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
66
namespace Magento\FunctionalTestingFramework\Data\Argument\Interpreter;

src/Magento/FunctionalTestingFramework/DataGenerator/Handlers/DataObjectHandler.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
26

37
namespace Magento\FunctionalTestingFramework\DataGenerator\Handlers;
48

src/Magento/FunctionalTestingFramework/DataGenerator/etc/dataOperation.xsd

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
29
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
310
<xs:element name="config">
411
<xs:complexType>

src/Magento/FunctionalTestingFramework/DataGenerator/etc/dataProfileSchema.xsd

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
29
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified"
310
xmlns:xs="http://www.w3.org/2001/XMLSchema">
411

src/Magento/FunctionalTestingFramework/Module/MagentoRestDriver.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
27
namespace Magento\FunctionalTestingFramework\Module;
38

49
use Codeception\Module\REST;

0 commit comments

Comments
 (0)