Skip to content

Commit d79ad1f

Browse files
authored
Merge pull request #428 from nexB/406-truncated-copyright-statement
#406 New rule to capture 'Copyright (c) 2012-2016, Project contributors'
2 parents 5a07a00 + 3354d39 commit d79ad1f

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/cluecode/copyrights.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,9 @@ def detect(location):
442442
443443
COPYRIGHT2: {<COPY> <COPY>? <YR-RANGE> <NNP> <NAME>}
444444
445+
# Copyright (c) 2012-2016, Project contributors
446+
COPYRIGHT2: {<COPY> <COPY>? <YR-RANGE> <COMP> <AUTH>}
447+
445448
COPYRIGHT2: {<NAME> <COPY> <YR-RANGE>}
446449
447450
COPYRIGHT2: {<COPY> <COPY>? <NN|CAPS>? <YR-RANGE>+ <NN|CAPS>*}

tests/cluecode/test_copyrights.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3981,3 +3981,13 @@ def test_copyright_with_sign_dash_and_dotted_name(self):
39813981
test_lines = [u'Copyright (c) 1999, 2000 - D.T.Shield.']
39823982
expected = [u'Copyright (c) 1999, 2000 - D.T.Shield.']
39833983
check_detection(expected, test_lines)
3984+
3985+
def test_copyright_with_sign_year_comp_and_auth(self):
3986+
test_lines = [u'Copyright (c) 2012-2016, Project contributors']
3987+
expected = [u'Copyright (c) 2012-2016, Project contributors']
3988+
check_detection(expected, test_lines)
3989+
3990+
def test_copyright_with_year_comp_and_auth(self):
3991+
test_lines = [u'Copyright 2012-2016, Project contributors']
3992+
expected = [u'Copyright 2012-2016, Project contributors']
3993+
check_detection(expected, test_lines)

0 commit comments

Comments
 (0)