Skip to content

Commit 623fe6c

Browse files
Fix test failures
Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
1 parent 6d93bba commit 623fe6c

23 files changed

+154
-28
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
license_expression: cclrc
3+
is_license_notice: yes
4+
referenced_filenames:
5+
- External_License/CCLRC_CDAT_License.txt
6+
---
7+
8+
* This software may be distributed under the terms of the
9+
* {{CCLRC Licence}} for CCLRC Software
10+
* <CDATDIR>/External_License/CCLRC_CDAT_License.txt
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
license_expression: cclrc
3+
is_license_notice: yes
4+
---
5+
6+
* This software may be distributed under the terms of the
7+
* {{CCLRC Licence}} for CCLRC Software

src/licensedcode/data/rules/mit_1182.RULE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
license_expression: mit
33
is_license_reference: yes
4+
is_required_phrase: yes
45
relevance: 100
56
---
67

src/licensedcode/data/rules/mit_334.RULE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ referenced_filenames:
66
- LICENSE
77
---
88

9-
This software is released under the MIT software license.
9+
This software is released under the {{MIT software license}}.
1010
This license, including disclaimer, is available in the 'LICENSE' file.

src/licensedcode/data/rules/mit_337.RULE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ ignorable_urls:
66
- http://www.opensource.org/licenses/mit-license.php
77
---
88

9-
This is the http://www.opensource.org/licenses/mit-license.php MIT Software License
9+
This is the http://www.opensource.org/licenses/mit-license.php {{MIT Software License}}
1010
which is OSI-certified, and GPL-compatible.

src/licensedcode/data/rules/mit_392.RULE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ ignorable_urls:
88
- http://www.opensource.org/licenses/mit-license.php
99
---
1010

11-
"Distributed under the MIT software license, see the accompanying file COPYING or
11+
"Distributed under the {{MIT software license}}, see the accompanying file COPYING or
1212
http://www.opensource.org/licenses/mit-license.php.

src/licensedcode/data/rules/mit_396.RULE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ referenced_filenames:
66
- COPYING
77
---
88

9-
// Distributed under the MIT software license, see the accompanying
9+
// Distributed under the {{MIT software license}}, see the accompanying
1010
// file COPYING

src/licensedcode/data/rules/mit_397.RULE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ ignorable_urls:
88
- http://www.opensource.org/licenses/mit-license.php
99
---
1010

11-
// Distributed under the MIT software license, see the accompanying
12-
// file COPYING or shttp://www.opensource.org/{{licenses/mit}}-license.php.
11+
// Distributed under the {{MIT software license}}, see the accompanying
12+
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

src/licensedcode/models.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1844,7 +1844,6 @@ def validate(self, licensing=None, thorough=False):
18441844
is_false_positive = self.is_false_positive
18451845

18461846
has_license_flags = any(self.license_flag_values)
1847-
has_no_license_flags = len([l for l in self.license_flag_values if l]) == 0
18481847
has_many_license_flags = len([l for l in self.license_flag_values if l]) > 1
18491848

18501849
license_expression = self.license_expression
@@ -1888,9 +1887,6 @@ def validate(self, licensing=None, thorough=False):
18881887

18891888
if not (0 <= self.relevance <= 100):
18901889
yield 'Invalid rule relevance. Should be between 0 and 100.'
1891-
1892-
if has_no_license_flags:
1893-
yield 'Invalid rule no is_license_* flags present.'
18941890

18951891
if has_many_license_flags:
18961892
yield 'Invalid rule is_license_* flags. Only one allowed.'

src/licensedcode/required_phrases.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,6 @@ def get_required_phrase_spans(text):
5252
>>> x = get_required_phrase_spans(text)
5353
>>> assert x == [Span(4, 6)], x
5454
55-
>>> text = 'This is enclosed in {{double curly braces}}'
56-
>>> # 0 1 2 3 4 5 6
57-
>>> x = get_required_phrase_spans(text)
58-
>>> assert x == ['double', 'curly', 'braces'], x
59-
6055
>>> text = 'This is {{enclosed}} a {{double curly braces}} or not'
6156
>>> # 0 1 2 SW 3 4 5 6 7
6257
>>> x = get_required_phrase_spans(text)
@@ -114,7 +109,7 @@ def get_required_phrase_texts(text):
114109
>>> text = 'This is enclosed in {{double curly braces}}'
115110
>>> # 0 1 2 3 4 5 6
116111
>>> x = get_required_phrase_texts(text=text)
117-
>>> assert x == ['double', 'curly', 'braces'], x
112+
>>> assert x == ['double curly braces'], x
118113
"""
119114
return [
120115
required_phrase.text

0 commit comments

Comments
 (0)