Skip to content

Commit 972df60

Browse files
Reorder codebase and resource attributes
* Reorder codebase and resource level attributes * replace `#` in license detection identifier with `-` * regenerate test expectations * reorder license rule references attributes * add rule text to license rule references data Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com>
1 parent e286a18 commit 972df60

File tree

86 files changed

+18070
-17240
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+18070
-17240
lines changed

src/cluecode/plugin_copyright.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class CopyrightScanner(ScanPlugin):
2828
('authors',attr.ib(default=attr.Factory(list))),
2929
])
3030

31-
sort_order = 4
31+
sort_order = 6
3232

3333
options = [
3434
PluggableCommandLineOption(('-c', '--copyright',),

src/cluecode/plugin_email.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class EmailScanner(ScanPlugin):
2525
"""
2626
resource_attributes = dict(emails=attr.ib(default=attr.Factory(list)))
2727

28-
sort_order = 8
28+
sort_order = 7
2929

3030
options = [
3131
PluggableCommandLineOption(('-e', '--email',),

src/cluecode/plugin_url.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class UrlScanner(ScanPlugin):
2626

2727
resource_attributes = dict(urls=attr.ib(default=attr.Factory(list)))
2828

29-
sort_order = 10
29+
sort_order = 8
3030

3131
options = [
3232
PluggableCommandLineOption(('-u', '--url',),

src/licensedcode/detection.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ def identifier(self):
292292
@property
293293
def identifier_with_expression(self):
294294
id_safe_expression = python_safe_name(s=str(self.license_expression))
295-
return "{}#{}".format(id_safe_expression, self.identifier)
295+
return "{}-{}".format(id_safe_expression, self.identifier)
296296

297297

298298
def get_start_end_line(self):
@@ -657,7 +657,7 @@ class UniqueDetection:
657657
"""
658658
identifier = attr.ib(default=None)
659659
license_expression = attr.ib(default=None)
660-
occurrence_count = attr.ib(default=None)
660+
count = attr.ib(default=None)
661661
detection_log = attr.ib(default=attr.Factory(list))
662662
matches = attr.ib(default=attr.Factory(list))
663663
files = attr.ib(factory=list)
@@ -693,7 +693,7 @@ def get_unique_detections(cls, license_detections):
693693
license_expression=detection_mapping["license_expression"],
694694
detection_log=detection_mapping["detection_log"],
695695
matches=detection_mapping["matches"],
696-
occurrence_count=len(files),
696+
count=len(files),
697697
files=files,
698698
)
699699
)

src/licensedcode/plugin_license.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class LicenseScanner(ScanPlugin):
7474
license_rule_references=attr.ib(default=attr.Factory(list))
7575
)
7676

77-
sort_order = 2
77+
sort_order = 4
7878

7979
options = [
8080
PluggableCommandLineOption(('-l', '--license'),

src/packagedcode/plugin_package.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,10 @@ class PackageScanner(ScanPlugin):
9191
"""
9292

9393
codebase_attributes = dict(
94-
# a list of dependencies
95-
dependencies=attr.ib(default=attr.Factory(list), repr=False),
9694
# a list of packages
9795
packages=attr.ib(default=attr.Factory(list), repr=False),
96+
# a list of dependencies
97+
dependencies=attr.ib(default=attr.Factory(list), repr=False),
9898
)
9999
resource_attributes = dict(
100100
# a list of package data
@@ -105,7 +105,7 @@ class PackageScanner(ScanPlugin):
105105

106106
required_plugins = ['scan:licenses']
107107

108-
sort_order = 6
108+
sort_order = 3
109109

110110
options = [
111111
PluggableCommandLineOption(

src/summarycode/classify_plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ class FileClassifier(PreScanPlugin):
9393

9494
])
9595

96-
sort_order = 50
96+
sort_order = 30
9797

9898
options = [
9999
PluggableCommandLineOption(('--classify',),

src/summarycode/plugin_consolidate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ class Consolidator(PostScanPlugin):
139139
consolidated_to=attr.ib(default=attr.Factory(list))
140140
)
141141

142-
sort_order = 8
142+
sort_order = 10
143143

144144
options = [
145145
PluggableCommandLineOption(('--consolidate',),

src/summarycode/summarizer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class ScanSummary(PostScanPlugin):
5555
Summarize a scan at the codebase level.
5656
"""
5757

58-
sort_order = 10
58+
sort_order = 2
5959

6060
codebase_attributes = dict(summary=attr.ib(default=attr.Factory(dict)))
6161

src/summarycode/tallies.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class Tallies(PostScanPlugin):
4747
"""
4848
Compute tallies for license, copyright and other scans at the codebase level
4949
"""
50-
sort_order = 10
50+
sort_order = 15
5151

5252
codebase_attributes = dict(tallies=attr.ib(default=attr.Factory(dict)))
5353

0 commit comments

Comments
 (0)