Skip to content

Commit e1c12ca

Browse files
committed
Improve copyright detection
Strip leading copyright signs from holders Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
1 parent fb8aea8 commit e1c12ca

File tree

5 files changed

+7
-5
lines changed

5 files changed

+7
-5
lines changed

src/cluecode/copyrights.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3700,6 +3700,7 @@ def is_junk_copyright(s, patterns=COPYRIGHTS_JUNK_PATTERN_MATCHERS):
37003700
"name'",
37013701
"a",
37023702
"moduleauthor",
3703+
"©",
37033704
])
37043705
))
37053706

@@ -3781,6 +3782,7 @@ def is_junk_copyright(s, patterns=COPYRIGHTS_JUNK_PATTERN_MATCHERS):
37813782
'later',
37823783
'$',
37833784
'current.year',
3785+
"©",
37843786
])
37853787
))
37863788

@@ -4321,7 +4323,7 @@ def remove_code_comment_markers(s):
43214323
Return ``s`` removing code comments such as C and C++ style comment markers and assimilated
43224324
43234325
>>> remove_code_comment_markers("\\*#%; /\\/*a*/b/*c\\d#e%f \\*#%; /")
4324-
'a b c d e f'
4326+
'a b c\\d e f'
43254327
"""
43264328
return (s
43274329
.replace('/*', ' ')

tests/packagedcode/data/debian/copyright/debian-slim-2021-04-07/usr/share/doc/gcc-10-base/copyright-detailed.expected.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2166,7 +2166,7 @@ copyright: |
21662166
Copyright (c) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019
21672167
Copyright (c) 2009-2019 by the LLVM contributors
21682168
Copyright (c) 1996-2003 Red Hat, Inc.
2169-
Copyright (c) 2009 Free Software Foundation, Inc. <http://fsf.org/>
2169+
Copyright (c) 2009 Free Software Foundation, Inc. http://fsf.org
21702170
Copyright (c) 2010 Free Software Foundation, Inc.
21712171
Copyright 2001 by Stephen L. Moshier <moshier@na-net.ornl.gov>
21722172
Copyright (c) 2001 Stephen L. Moshier <moshier@na-net.ornl.gov>

tests/packagedcode/data/debian/copyright/debian-slim-2021-04-07/usr/share/doc/gcc-9-base/copyright-detailed.expected.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2425,7 +2425,7 @@ copyright: |
24252425
Copyright (c) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019
24262426
Copyright (c) 2009-2014 by the LLVM contributors
24272427
Copyright (c) 1996-2003 Red Hat, Inc.
2428-
Copyright (c) 2009 Free Software Foundation, Inc. <http://fsf.org/>
2428+
Copyright (c) 2009 Free Software Foundation, Inc. http://fsf.org
24292429
Copyright (c) 2010 Free Software Foundation, Inc.
24302430
Copyright 2001 by Stephen L. Moshier <moshier@na-net.ornl.gov>
24312431
Copyright (c) 2001 Stephen L. Moshier <moshier@na-net.ornl.gov>

tests/packagedcode/data/debian/copyright/debian-slim-2021-04-07/usr/share/doc/libext2fs2/copyright-detailed.expected.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ other_license_detections: []
9898
copyright: |
9999
Copyright (c) 2003-2007 Theodore Ts'o <tytso@mit.edu>
100100
Copyright (c) 1997-2003 Yann Dirson <dirson@debian.org>
101-
Copyright (c) 2001 Alcove <http://www.alcove.com/>
101+
Copyright (c) 2001 Alcove http://www.alcove.com
102102
Copyright (c) 1997 Klee Dienes
103103
Copyright (c) 1995-1996 Michael Nonweiler <mrn20@cam.ac.uk>
104104
Copyright (c) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by Theodore Ts'o

tests/packagedcode/data/debian/copyright/debian-slim-2021-04-07/usr/share/doc/logsave/copyright-detailed.expected.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ other_license_detections: []
9898
copyright: |
9999
Copyright (c) 2003-2007 Theodore Ts'o <tytso@mit.edu>
100100
Copyright (c) 1997-2003 Yann Dirson <dirson@debian.org>
101-
Copyright (c) 2001 Alcove <http://www.alcove.com/>
101+
Copyright (c) 2001 Alcove http://www.alcove.com
102102
Copyright (c) 1997 Klee Dienes
103103
Copyright (c) 1995-1996 Michael Nonweiler <mrn20@cam.ac.uk>
104104
Copyright (c) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by Theodore Ts'o

0 commit comments

Comments
 (0)