Skip to content

Commit a315d07

Browse files
committed
[DEVOPS-637] always fulll scan for copyright on README and package.rst
1 parent 7bfb5e0 commit a315d07

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

‎mirageoscience/hooks/check_copyright.py‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020

2121
MAX_TOP_LINES = 10
22+
_FULL_SCAN_FILE_NAMES = ["README.rst", "README-dev.rst", "package.rst"]
2223

2324

2425
def check_files(
@@ -85,12 +86,12 @@ def main():
8586
"--full-scan-files",
8687
nargs="+",
8788
help=f"list of files to scan entirely, instead of checking only the {MAX_TOP_LINES} top lines",
88-
default=["README.rst", "README-dev.rst", "package.rst"],
89+
default=[],
8990
required=False,
9091
)
9192

9293
args = parser.parse_args()
93-
if not check_files(args.files, args.full_scan_files):
94+
if not check_files(args.files, _FULL_SCAN_FILE_NAMES + args.full_scan_files):
9495
sys.exit(1)
9596

9697

‎tests/check_copyright_test.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
import pytest
1818

19-
from mirageoscience.hooks.check_copyright import check_files
19+
from mirageoscience.hooks.check_copyright import _FULL_SCAN_FILE_NAMES, check_files
2020
from mirageoscience.hooks.check_copyright import main as check_copyright_main
2121

2222

@@ -126,5 +126,5 @@ def test_main_with_full_scan_files():
126126
mock_check_files.return_value = True
127127
check_copyright_main()
128128
mock_check_files.assert_called_once_with(
129-
["file1.py"], ["full_file1.py", "full_file2.py"]
129+
["file1.py"], [*_FULL_SCAN_FILE_NAMES, "full_file1.py", "full_file2.py"]
130130
)

0 commit comments

Comments
 (0)