Skip to content

Commit 56bd766

Browse files
committed
Do not report A. as a proper noun in copyrights
A single uppercase letter followed by a dot is a not proper noun. This is a source of false positive detection otherwise. Signed-off-by: Philippe Ombredanne <[email protected]>
1 parent e2364c8 commit 56bd766

File tree

3 files changed

+47
-0
lines changed

3 files changed

+47
-0
lines changed

src/cluecode/copyrights.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -600,6 +600,9 @@ def from_node(
600600
# parens such as (1) or (a) is a sign of junk but of course NOT (c)
601601
(r'^\(([abdefghi\d]|ii|iii)\)$', 'JUNK'),
602602

603+
# Single uppercase letters followed by a period
604+
(r'^[A-Z]\.$', 'JUNK'),
605+
603606
# found in crypto certificates and LDAP
604607
(r'^O=$', 'JUNK'),
605608
(r'^OU=?$', 'JUNK'),
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# order to be recognized. For example, each of these is fine:
2+
#
3+
# Copyright @copyright{} 1990-2005, 2007-2009 Free Software
4+
# Foundation, Inc.
5+
#
6+
# # Copyright (C) 1990-2005, 2007-2009 Free Software
7+
# # Foundation, Inc.
8+
#
9+
# /*
10+
# * Copyright &copy; 90,2005,2007-2009
11+
# * Free Software Foundation, Inc.
12+
# */
13+
#
14+
# However, the following format is not recognized because the line
15+
# prefix changes after the first line:
16+
#
17+
# ## Copyright (C) 1990-2005, 2007-2009 Free Software
18+
# # Foundation, Inc.
19+
#
20+
# However, any correctly formatted copyright statement following
21+
# a non-matching copyright statements would be recognized.
22+
#
23+
# 2. Its format is "Copyright (C)", then a list of copyright years,
24+
# and then the name of the copyright holder.
25+
# 3. The "(C)" takes one of the following forms or is omitted
26+
# entirely:
27+
#
28+
# A. (C)
29+
# B. (c)
30+
# C. @copyright{}
31+
# D. &copy;
32+
# E. ©
33+
#
34+
# 4. The "Copyright" appears at the beginning of a line, except that it
35+
# may be prefixed by any sequence (e.g., a comment) of no more than
36+
# 5 characters -- including white space.
37+
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
what:
2+
- copyrights
3+
copyrights:
4+
- Copyright 1990-2005, 2007-2009 Free Software Foundation, Inc.
5+
- Copyright (c) 1990-2005, 2007-2009 Free Software Foundation, Inc.
6+
- Copyright (c) 90,2005,2007-2009 Free Software Foundation, Inc.
7+
- Copyright (c) 1990-2005, 2007-2009 Free Software Foundation, Inc.

0 commit comments

Comments
 (0)