Skip to content

Commit e87c605

Browse files
pombredannejdaguil
authored andcommitted
Fixed #115
* added new variant of copyright statement * also renamed the env var used for copyright debugging
1 parent 28564d5 commit e87c605

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/cluecode/copyrights.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939

4040
logger = logging.getLogger(__name__)
41-
if os.environ.get('SC_COPYRIGHT_DEBUG'):
41+
if os.environ.get('SCANCODE_COPYRIGHT_DEBUG'):
4242
import sys
4343
logging.basicConfig(level=logging.DEBUG, stream=sys.stdout)
4444
logger.setLevel(logging.DEBUG)
@@ -365,6 +365,8 @@ def detect(location):
365365
COPYRIGHT: {<COPY> <COPY> <NN> <NAME> <YR-RANGE>}
366366
COPYRIGHT: {<COPY> <NN> <NAME> <YR-RANGE>}
367367
368+
COPYRIGHT: {<COPY>+ <BY> <NAME|NAME2|NAME3>+}
369+
368370
COPYRIGHT: {<COPY> <COPY> <COMP>+}
369371
370372
COPYRIGHT: {<COPY> <COPY> <NN>+ <COMPANY|NAME|NAME2>+}

tests/cluecode/test_copyrights.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1253,7 +1253,6 @@ def test_copyright_java(self):
12531253
]
12541254
check_detection(expected, test_file)
12551255

1256-
@expectedFailure
12571256
def test_copyright_java_passing(self):
12581257
test_file = self.get_test_loc('copyrights/copyright_java-java.java')
12591258
expected = [
@@ -3939,3 +3938,8 @@ def test_copyright_with_dots_and_all_lowercase_on_single_line(self):
39393938
test_lines = [u'Copyright . 2008 foo name, inc.']
39403939
expected = [u'Copyright . 2008 foo name, inc.']
39413940
check_detection(expected, test_lines)
3941+
3942+
def test_copyright_copy_copy_by_name3(self):
3943+
test_lines = [u'Copyright (c) by 2007 Joachim Foerster <[email protected]>']
3944+
expected = [u'Copyright (c) by 2007 Joachim Foerster <[email protected]>']
3945+
check_detection(expected, test_lines)

0 commit comments

Comments
 (0)