pbiplint 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json ADDED
@@ -0,0 +1,48 @@
1
+ {
2
+ "name": "pbiplint",
3
+ "version": "0.1.0",
4
+ "description": "Lint Power BI semantic models (TMDL) for best-practice violations, with text, JSON, SARIF, and Markdown output. Nothing is uploaded.",
5
+ "keywords": [
6
+ "power-bi",
7
+ "tmdl",
8
+ "semantic-model",
9
+ "pbip",
10
+ "linter",
11
+ "best-practices",
12
+ "sarif",
13
+ "cli"
14
+ ],
15
+ "license": "AGPL-3.0-or-later",
16
+ "author": "McKinley Consulting",
17
+ "homepage": "https://pbiplint.com",
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "git+https://github.com/pbiplint/pbiplint.git",
21
+ "directory": "packages/cli"
22
+ },
23
+ "bugs": {
24
+ "url": "https://github.com/pbiplint/pbiplint/issues"
25
+ },
26
+ "type": "module",
27
+ "bin": {
28
+ "pbiplint": "./dist/pbiplint.mjs"
29
+ },
30
+ "files": [
31
+ "dist",
32
+ "sample",
33
+ "README.md",
34
+ "NOTICE",
35
+ "LICENSE"
36
+ ],
37
+ "publishConfig": {
38
+ "access": "public"
39
+ },
40
+ "scripts": {
41
+ "build": "node build.mjs",
42
+ "prepack": "npm run build",
43
+ "test:bundle": "node dist/pbiplint.mjs --sample --format json > /dev/null; test $? -eq 1"
44
+ },
45
+ "engines": {
46
+ "node": ">=20"
47
+ }
48
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "$schema": "https://developer.microsoft.com/json-schemas/fabric/item/semanticModel/editorSettings/1.0.0/schema.json",
3
+ "autodetectRelationships": false,
4
+ "parallelQueryLoading": true,
5
+ "typeDetectionEnabled": true,
6
+ "relationshipImportEnabled": false,
7
+ "shouldNotifyUserOfNameConflictResolution": true
8
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "$schema": "https://developer.microsoft.com/json-schemas/fabric/gitIntegration/platformProperties/2.0.0/schema.json",
3
+ "metadata": {
4
+ "type": "SemanticModel",
5
+ "displayName": "Sales Demo"
6
+ },
7
+ "config": {
8
+ "version": "2.0",
9
+ "logicalId": "2a5eec77-fc61-50ad-b331-580c7bf7cb0c"
10
+ }
11
+ }
@@ -0,0 +1,2 @@
1
+ cultureInfo en-US
2
+
@@ -0,0 +1,3 @@
1
+ database
2
+ compatibilityLevel: 1600
3
+
@@ -0,0 +1,24 @@
1
+ model Model
2
+ culture: en-US
3
+ defaultPowerBIDataSourceVersion: powerBI_V3
4
+ sourceQueryCulture: en-US
5
+ dataAccessOptions
6
+ legacyRedirects
7
+ returnErrorValuesAsNull
8
+
9
+ annotation __PBI_TimeIntelligenceEnabled = 1
10
+
11
+ annotation PBI_ProTooling = ["DevMode"]
12
+
13
+ annotation PBI_QueryOrder = ["Sales","Date","Product","Customer","Store","Employee","Promotion"]
14
+
15
+ ref table Sales
16
+ ref table Date
17
+ ref table Product
18
+ ref table Customer
19
+ ref table Store
20
+ ref table Employee
21
+ ref table Promotion
22
+
23
+ ref cultureInfo en-US
24
+
@@ -0,0 +1,23 @@
1
+ relationship 8f6329ea-7a97-59d8-906c-ee02e1d79158
2
+ fromColumn: Sales.'Product ID'
3
+ toColumn: Product.'Product ID'
4
+
5
+ relationship 8733974e-19f7-50c5-a5cd-64b565554e0e
6
+ fromColumn: Sales.'Customer ID'
7
+ toColumn: Customer.'Customer ID'
8
+
9
+ relationship 28714507-189f-5b8b-8e59-0b55a5d65096
10
+ fromColumn: Sales.'Sale Date'
11
+ toColumn: Date.Date
12
+
13
+ relationship 2cf9b5a2-6bd2-5d41-aee4-d153a32261c5
14
+ fromColumn: Sales.'Store ID'
15
+ toColumn: Store.'Store ID'
16
+
17
+ relationship 5b883d70-11cb-59ee-bf31-c706854ce0a7
18
+ fromColumn: Sales.'Employee ID'
19
+ toColumn: Employee.'Employee ID'
20
+
21
+ relationship 4862abb4-bb60-51c5-8127-c4d618a3c29a
22
+ fromColumn: Sales.'Promotion ID'
23
+ toColumn: Promotion.'Promotion ID'
@@ -0,0 +1,107 @@
1
+ table Customer
2
+ lineageTag: e9d2e6ee-e373-5a84-94c4-bb4aa85275b8
3
+
4
+ column 'Customer ID'
5
+ dataType: int64
6
+ isKey
7
+ lineageTag: 5ce62e29-bd98-5b2c-9529-a47378a6596d
8
+ summarizeBy: none
9
+ sourceColumn: Customer ID
10
+
11
+ annotation SummarizationSetBy = Automatic
12
+
13
+ column 'Customer Name'
14
+ dataType: string
15
+ lineageTag: dfe76534-4f10-56c5-b590-6f84ca127ce1
16
+ summarizeBy: none
17
+ sourceColumn: Customer Name
18
+
19
+ annotation SummarizationSetBy = Automatic
20
+
21
+ column Segment
22
+ dataType: string
23
+ lineageTag: 17767c18-689a-5190-b942-004eb49aef36
24
+ summarizeBy: none
25
+ sourceColumn: Segment
26
+
27
+ annotation SummarizationSetBy = Automatic
28
+
29
+ column Region
30
+ dataType: string
31
+ lineageTag: 7c28bda2-4a6f-5d61-88f7-ac1551a41482
32
+ summarizeBy: none
33
+ sourceColumn: Region
34
+
35
+ annotation SummarizationSetBy = Automatic
36
+
37
+ column City
38
+ dataType: string
39
+ lineageTag: f026dd47-62b6-5557-bb57-2c3234f10c5e
40
+ summarizeBy: none
41
+ sourceColumn: City
42
+
43
+ annotation SummarizationSetBy = Automatic
44
+
45
+ column State
46
+ dataType: string
47
+ lineageTag: bd455366-9d71-5c4f-a310-3b489a5e912a
48
+ summarizeBy: none
49
+ sourceColumn: State
50
+
51
+ annotation SummarizationSetBy = Automatic
52
+
53
+ column 'Postal Code'
54
+ dataType: string
55
+ lineageTag: db27ea4d-571c-584c-adec-400bbc15a855
56
+ summarizeBy: none
57
+ sourceColumn: Postal Code
58
+
59
+ annotation SummarizationSetBy = Automatic
60
+
61
+ column Country
62
+ dataType: string
63
+ lineageTag: 6dc206e0-b8e2-58c5-b6ee-ffaab758639b
64
+ summarizeBy: none
65
+ sourceColumn: Country
66
+
67
+ annotation SummarizationSetBy = Automatic
68
+
69
+ column Email
70
+ dataType: string
71
+ lineageTag: 84288c04-01aa-5bf0-8298-a94dc4ba81d7
72
+ summarizeBy: none
73
+ sourceColumn: Email
74
+
75
+ annotation SummarizationSetBy = Automatic
76
+
77
+ column 'Join Date'
78
+ dataType: dateTime
79
+ formatString: Long Date
80
+ lineageTag: 6387e0dd-a104-5d04-83be-dd4c7a71799f
81
+ summarizeBy: none
82
+ sourceColumn: Join Date
83
+
84
+ annotation SummarizationSetBy = Automatic
85
+
86
+ annotation UnderlyingDateTimeDataType = Date
87
+
88
+ column 'Loyalty Tier'
89
+ dataType: string
90
+ lineageTag: f50d42ec-a890-5dd9-8e75-8d7df228c848
91
+ summarizeBy: none
92
+ sourceColumn: Loyalty Tier
93
+
94
+ annotation SummarizationSetBy = Automatic
95
+
96
+ partition Customer = m
97
+ mode: import
98
+ source =
99
+ let
100
+ Source = Csv.Document(File.Contents("C:\Demo\Data\Customer.csv"), [Delimiter=",", Columns=11, Encoding=65001, QuoteStyle=QuoteStyle.Csv]),
101
+ #"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),
102
+ #"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers", {{"Customer ID", Int64.Type}, {"Customer Name", Text.Type}, {"Segment", Text.Type}, {"Region", Text.Type}, {"City", Text.Type}, {"State", Text.Type}, {"Postal Code", Text.Type}, {"Country", Text.Type}, {"Email", Text.Type}, {"Join Date", type date}, {"Loyalty Tier", Text.Type}})
103
+ in
104
+ #"Changed Type"
105
+
106
+ annotation PBI_ResultType = Table
107
+
@@ -0,0 +1,99 @@
1
+ table Date
2
+ lineageTag: d1d4ee17-d5be-573b-bd9a-a8955e86f8b9
3
+
4
+ column Date
5
+ dataType: dateTime
6
+ isKey
7
+ formatString: Long Date
8
+ lineageTag: 91859de7-3b1e-536c-b4f0-8d7558d84c6c
9
+ summarizeBy: none
10
+ sourceColumn: Date
11
+
12
+ annotation SummarizationSetBy = Automatic
13
+
14
+ annotation UnderlyingDateTimeDataType = Date
15
+
16
+ column Year
17
+ dataType: int64
18
+ lineageTag: ebf4bc37-2d01-50ce-9dd8-3126580d99eb
19
+ summarizeBy: none
20
+ sourceColumn: Year
21
+
22
+ annotation SummarizationSetBy = Automatic
23
+
24
+ column Quarter
25
+ dataType: string
26
+ lineageTag: de4b3788-25f6-5336-bc3b-f5718e100e35
27
+ summarizeBy: none
28
+ sourceColumn: Quarter
29
+
30
+ annotation SummarizationSetBy = Automatic
31
+
32
+ column 'Quarter Number'
33
+ dataType: int64
34
+ lineageTag: 3059bb2d-71dc-5e6d-a5a6-061a4a90cc40
35
+ summarizeBy: none
36
+ sourceColumn: Quarter Number
37
+
38
+ annotation SummarizationSetBy = Automatic
39
+
40
+ column Month
41
+ dataType: string
42
+ lineageTag: 14cf4274-fe64-5adb-999e-51d024685f58
43
+ summarizeBy: none
44
+ sourceColumn: Month
45
+
46
+ annotation SummarizationSetBy = Automatic
47
+
48
+ column 'Month Number'
49
+ dataType: int64
50
+ lineageTag: ba566318-e37d-5b8a-86dd-63cbdf3d7afb
51
+ summarizeBy: none
52
+ sourceColumn: Month Number
53
+
54
+ annotation SummarizationSetBy = Automatic
55
+
56
+ column 'Day of Week'
57
+ dataType: string
58
+ lineageTag: 660894b8-5858-5543-8421-0d60318bb14e
59
+ summarizeBy: none
60
+ sourceColumn: Day of Week
61
+
62
+ annotation SummarizationSetBy = Automatic
63
+
64
+ column 'Day Number'
65
+ dataType: int64
66
+ lineageTag: 6e3a6206-3d86-5585-a685-ec788ddc23cb
67
+ summarizeBy: none
68
+ sourceColumn: Day Number
69
+
70
+ annotation SummarizationSetBy = Automatic
71
+
72
+ column 'Week of Year'
73
+ dataType: int64
74
+ lineageTag: 15df69fe-9aa3-5fa3-ac12-b3a3de5eef77
75
+ summarizeBy: none
76
+ sourceColumn: Week of Year
77
+
78
+ annotation SummarizationSetBy = Automatic
79
+
80
+ column 'Is Weekend'
81
+ dataType: boolean
82
+ lineageTag: b4cb04ff-e831-5732-9bd9-379aef6187f7
83
+ summarizeBy: none
84
+ sourceColumn: Is Weekend
85
+
86
+ annotation SummarizationSetBy = Automatic
87
+
88
+ partition Date = m
89
+ mode: import
90
+ source =
91
+ let
92
+ Source = Csv.Document(File.Contents("C:\Demo\Data\Date.csv"), [Delimiter=",", Columns=10, Encoding=65001, QuoteStyle=QuoteStyle.Csv]),
93
+ #"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),
94
+ #"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers", {{"Date", type date}, {"Year", Int64.Type}, {"Quarter", Text.Type}, {"Quarter Number", Int64.Type}, {"Month", Text.Type}, {"Month Number", Int64.Type}, {"Day of Week", Text.Type}, {"Day Number", Int64.Type}, {"Week of Year", Int64.Type}, {"Is Weekend", Logical.Type}})
95
+ in
96
+ #"Changed Type"
97
+
98
+ annotation PBI_ResultType = Table
99
+
@@ -0,0 +1,83 @@
1
+ table Employee
2
+ lineageTag: 6c6ba8b8-eac3-579e-9f88-96a7b4219875
3
+
4
+ column 'Employee ID'
5
+ dataType: int64
6
+ isKey
7
+ lineageTag: c33865e5-d843-531c-b902-fbfa905607cc
8
+ summarizeBy: none
9
+ sourceColumn: Employee ID
10
+
11
+ annotation SummarizationSetBy = Automatic
12
+
13
+ column 'Employee Name'
14
+ dataType: string
15
+ lineageTag: 7950d647-8d6b-5f2a-b4c1-d1269cde214d
16
+ summarizeBy: none
17
+ sourceColumn: Employee Name
18
+
19
+ annotation SummarizationSetBy = Automatic
20
+
21
+ column Title
22
+ dataType: string
23
+ lineageTag: 3d37ca5a-fe25-5a18-be6f-a836d48869f4
24
+ summarizeBy: none
25
+ sourceColumn: Title
26
+
27
+ annotation SummarizationSetBy = Automatic
28
+
29
+ column Department
30
+ dataType: string
31
+ lineageTag: 8510c798-0da3-5dc4-9eb0-b45adb9314cb
32
+ summarizeBy: none
33
+ sourceColumn: Department
34
+
35
+ annotation SummarizationSetBy = Automatic
36
+
37
+ column 'Hire Date'
38
+ dataType: dateTime
39
+ formatString: Long Date
40
+ lineageTag: fae6dc05-0ed0-578e-ad4e-6ab935e74a27
41
+ summarizeBy: none
42
+ sourceColumn: Hire Date
43
+
44
+ annotation SummarizationSetBy = Automatic
45
+
46
+ annotation UnderlyingDateTimeDataType = Date
47
+
48
+ column 'Manager ID'
49
+ dataType: int64
50
+ lineageTag: 3a704eb2-4e30-57aa-bdf9-62728fbbf112
51
+ summarizeBy: none
52
+ sourceColumn: Manager ID
53
+
54
+ annotation SummarizationSetBy = Automatic
55
+
56
+ column Region
57
+ dataType: string
58
+ lineageTag: 7b99ec00-fd9b-560a-9dab-6f2ff34639a1
59
+ summarizeBy: none
60
+ sourceColumn: Region
61
+
62
+ annotation SummarizationSetBy = Automatic
63
+
64
+ column Email
65
+ dataType: string
66
+ lineageTag: e38684c7-30e0-598e-ae3d-1f3d00d4fbe7
67
+ summarizeBy: none
68
+ sourceColumn: Email
69
+
70
+ annotation SummarizationSetBy = Automatic
71
+
72
+ partition Employee = m
73
+ mode: import
74
+ source =
75
+ let
76
+ Source = Csv.Document(File.Contents("C:\Demo\Data\Employee.csv"), [Delimiter=",", Columns=8, Encoding=65001, QuoteStyle=QuoteStyle.Csv]),
77
+ #"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),
78
+ #"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers", {{"Employee ID", Int64.Type}, {"Employee Name", Text.Type}, {"Title", Text.Type}, {"Department", Text.Type}, {"Hire Date", type date}, {"Manager ID", Int64.Type}, {"Region", Text.Type}, {"Email", Text.Type}})
79
+ in
80
+ #"Changed Type"
81
+
82
+ annotation PBI_ResultType = Table
83
+
@@ -0,0 +1,104 @@
1
+ table Product
2
+ lineageTag: 06cbf34b-4079-5016-a55b-40c6437d5636
3
+
4
+ column 'Product ID'
5
+ dataType: int64
6
+ isKey
7
+ lineageTag: ea1b6f51-3cb2-5393-bf37-d48f7259183e
8
+ summarizeBy: none
9
+ sourceColumn: Product ID
10
+
11
+ annotation SummarizationSetBy = Automatic
12
+
13
+ column 'Product Name'
14
+ dataType: string
15
+ lineageTag: 2b2393a4-92ce-547c-9171-ef4e4894ec8e
16
+ summarizeBy: none
17
+ sourceColumn: Product Name
18
+
19
+ annotation SummarizationSetBy = Automatic
20
+
21
+ column Category
22
+ dataType: string
23
+ lineageTag: d44274f7-6558-5988-8ee5-7ba5419cf064
24
+ summarizeBy: none
25
+ sourceColumn: Category
26
+
27
+ annotation SummarizationSetBy = Automatic
28
+
29
+ column Subcategory
30
+ dataType: string
31
+ lineageTag: 4d810712-dd23-597f-8aa5-b30ede580aec
32
+ summarizeBy: none
33
+ sourceColumn: Subcategory
34
+
35
+ annotation SummarizationSetBy = Automatic
36
+
37
+ column Brand
38
+ dataType: string
39
+ lineageTag: 2b5f87eb-683f-5dad-a448-27a90e1ebb2e
40
+ summarizeBy: none
41
+ sourceColumn: Brand
42
+
43
+ annotation SummarizationSetBy = Automatic
44
+
45
+ column Color
46
+ dataType: string
47
+ lineageTag: 02ac636f-1644-5859-8f33-0619232930cc
48
+ summarizeBy: none
49
+ sourceColumn: Color
50
+
51
+ annotation SummarizationSetBy = Automatic
52
+
53
+ column Size
54
+ dataType: string
55
+ lineageTag: fb68e549-1989-5e0f-98d2-1c833e74658d
56
+ summarizeBy: none
57
+ sourceColumn: Size
58
+
59
+ annotation SummarizationSetBy = Automatic
60
+
61
+ column 'Standard Cost'
62
+ dataType: decimal
63
+ lineageTag: 7d9eacb7-55e6-5070-91c7-17f18bab7916
64
+ summarizeBy: none
65
+ sourceColumn: Standard Cost
66
+
67
+ annotation SummarizationSetBy = Automatic
68
+
69
+ column 'List Price'
70
+ dataType: decimal
71
+ lineageTag: 3e06604b-192f-5584-a99f-00747597dbc3
72
+ summarizeBy: none
73
+ sourceColumn: List Price
74
+
75
+ annotation SummarizationSetBy = Automatic
76
+
77
+ column 'Supplier Name'
78
+ dataType: string
79
+ lineageTag: 20522dd5-1f10-5eca-bca9-422e29d47a9f
80
+ summarizeBy: none
81
+ sourceColumn: Supplier Name
82
+
83
+ annotation SummarizationSetBy = Automatic
84
+
85
+ column Discontinued
86
+ dataType: boolean
87
+ lineageTag: 867a2b28-d8d7-5ecd-8ad9-8231245e1b80
88
+ summarizeBy: none
89
+ sourceColumn: Discontinued
90
+
91
+ annotation SummarizationSetBy = Automatic
92
+
93
+ partition Product = m
94
+ mode: import
95
+ source =
96
+ let
97
+ Source = Csv.Document(File.Contents("C:\Demo\Data\Product.csv"), [Delimiter=",", Columns=11, Encoding=65001, QuoteStyle=QuoteStyle.Csv]),
98
+ #"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),
99
+ #"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers", {{"Product ID", Int64.Type}, {"Product Name", Text.Type}, {"Category", Text.Type}, {"Subcategory", Text.Type}, {"Brand", Text.Type}, {"Color", Text.Type}, {"Size", Text.Type}, {"Standard Cost", Currency.Type}, {"List Price", Currency.Type}, {"Supplier Name", Text.Type}, {"Discontinued", Logical.Type}})
100
+ in
101
+ #"Changed Type"
102
+
103
+ annotation PBI_ResultType = Table
104
+
@@ -0,0 +1,70 @@
1
+ table Promotion
2
+ lineageTag: 5d7c9e48-4c96-5567-8d00-a1987c38cad8
3
+
4
+ column 'Promotion ID'
5
+ dataType: int64
6
+ isKey
7
+ lineageTag: da81a7bb-30e7-5013-8ddb-27030239dcdc
8
+ summarizeBy: none
9
+ sourceColumn: Promotion ID
10
+
11
+ annotation SummarizationSetBy = Automatic
12
+
13
+ column 'Promotion Name'
14
+ dataType: string
15
+ lineageTag: 2e80c670-0382-5460-850d-ab7866bb24a0
16
+ summarizeBy: none
17
+ sourceColumn: Promotion Name
18
+
19
+ annotation SummarizationSetBy = Automatic
20
+
21
+ column 'Promotion Type'
22
+ dataType: string
23
+ lineageTag: 48a89c2a-aa66-54a2-aa3e-65117f63ccaf
24
+ summarizeBy: none
25
+ sourceColumn: Promotion Type
26
+
27
+ annotation SummarizationSetBy = Automatic
28
+
29
+ column 'Discount Pct'
30
+ dataType: double
31
+ lineageTag: aac25df9-017e-5fa9-a04a-7188e3c2b942
32
+ summarizeBy: none
33
+ sourceColumn: Discount Pct
34
+
35
+ annotation SummarizationSetBy = Automatic
36
+
37
+ column 'Start Date'
38
+ dataType: dateTime
39
+ formatString: Long Date
40
+ lineageTag: cb587125-464c-5dc9-aa64-5960bd844d5f
41
+ summarizeBy: none
42
+ sourceColumn: Start Date
43
+
44
+ annotation SummarizationSetBy = Automatic
45
+
46
+ annotation UnderlyingDateTimeDataType = Date
47
+
48
+ column 'End Date'
49
+ dataType: dateTime
50
+ formatString: Long Date
51
+ lineageTag: 6fa83b4a-1007-5f43-8bc4-f3bbf0a80b38
52
+ summarizeBy: none
53
+ sourceColumn: End Date
54
+
55
+ annotation SummarizationSetBy = Automatic
56
+
57
+ annotation UnderlyingDateTimeDataType = Date
58
+
59
+ partition Promotion = m
60
+ mode: import
61
+ source =
62
+ let
63
+ Source = Csv.Document(File.Contents("C:\Demo\Data\Promotion.csv"), [Delimiter=",", Columns=6, Encoding=65001, QuoteStyle=QuoteStyle.Csv]),
64
+ #"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),
65
+ #"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers", {{"Promotion ID", Int64.Type}, {"Promotion Name", Text.Type}, {"Promotion Type", Text.Type}, {"Discount Pct", Double.Type}, {"Start Date", type date}, {"End Date", type date}})
66
+ in
67
+ #"Changed Type"
68
+
69
+ annotation PBI_ResultType = Table
70
+