@@ -64,7 +64,7 @@ func BoardsTxtBoardIDNameMissing() (result ruleresult.Type, output string) {
64
64
return ruleresult .Skip , "boards.txt has no boards"
65
65
}
66
66
67
- nonCompliantBoardIDs := boardIDMissingRequiredProperty ( "name" , compliancelevel .Specification )
67
+ nonCompliantBoardIDs := iDMissingRequiredProperty ( projectdata . BoardsTxtBoardIds (), "name" , projectdata . BoardsTxtSchemaValidationResult ()[ compliancelevel .Specification ] )
68
68
69
69
if len (nonCompliantBoardIDs ) > 0 {
70
70
return ruleresult .Fail , strings .Join (nonCompliantBoardIDs , ", " )
@@ -83,7 +83,7 @@ func BoardsTxtBoardIDNameLTMinLength() (result ruleresult.Type, output string) {
83
83
return ruleresult .Skip , "boards.txt has no boards"
84
84
}
85
85
86
- nonCompliantBoardIDs := boardIDValueLTMinLength ( "name" , compliancelevel .Specification )
86
+ nonCompliantBoardIDs := iDValueLTMinLength ( projectdata . BoardsTxtBoardIds (), "name" , projectdata . BoardsTxtSchemaValidationResult ()[ compliancelevel .Specification ] )
87
87
88
88
if len (nonCompliantBoardIDs ) > 0 {
89
89
return ruleresult .Fail , strings .Join (nonCompliantBoardIDs , ", " )
@@ -102,7 +102,7 @@ func BoardsTxtBoardIDBuildBoardMissing() (result ruleresult.Type, output string)
102
102
return ruleresult .Skip , "boards.txt has no boards"
103
103
}
104
104
105
- nonCompliantBoardIDs := boardIDMissingRequiredProperty ( "build\\ .board" , compliancelevel .Strict )
105
+ nonCompliantBoardIDs := iDMissingRequiredProperty ( projectdata . BoardsTxtBoardIds (), "build\\ .board" , projectdata . BoardsTxtSchemaValidationResult ()[ compliancelevel .Strict ] )
106
106
107
107
if len (nonCompliantBoardIDs ) > 0 {
108
108
return ruleresult .Fail , strings .Join (nonCompliantBoardIDs , ", " )
@@ -121,7 +121,7 @@ func BoardsTxtBoardIDBuildBoardLTMinLength() (result ruleresult.Type, output str
121
121
return ruleresult .Skip , "boards.txt has no boards"
122
122
}
123
123
124
- nonCompliantBoardIDs := boardIDValueLTMinLength ( "build\\ .board" , compliancelevel .Specification )
124
+ nonCompliantBoardIDs := iDValueLTMinLength ( projectdata . BoardsTxtBoardIds (), "build\\ .board" , projectdata . BoardsTxtSchemaValidationResult ()[ compliancelevel .Specification ] )
125
125
126
126
if len (nonCompliantBoardIDs ) > 0 {
127
127
return ruleresult .Fail , strings .Join (nonCompliantBoardIDs , ", " )
@@ -136,11 +136,11 @@ func BoardsTxtBoardIDBuildCoreMissing() (result ruleresult.Type, output string)
136
136
return ruleresult .NotRun , "Couldn't load boards.txt"
137
137
}
138
138
139
- if len (projectdata .BoardsTxtBoardIds ()) == 0 {
140
- return ruleresult .Skip , "boards.txt has no boards"
139
+ if len (projectdata .BoardsTxtVisibleBoardIds ()) == 0 {
140
+ return ruleresult .Skip , "boards.txt has no visible boards"
141
141
}
142
142
143
- nonCompliantBoardIDs := boardIDMissingRequiredProperty ( "build\\ .core" , compliancelevel .Specification )
143
+ nonCompliantBoardIDs := iDMissingRequiredProperty ( projectdata . BoardsTxtVisibleBoardIds (), "build\\ .core" , projectdata . BoardsTxtSchemaValidationResult ()[ compliancelevel .Specification ] )
144
144
145
145
if len (nonCompliantBoardIDs ) > 0 {
146
146
return ruleresult .Fail , strings .Join (nonCompliantBoardIDs , ", " )
@@ -155,11 +155,11 @@ func BoardsTxtBoardIDBuildCoreLTMinLength() (result ruleresult.Type, output stri
155
155
return ruleresult .NotRun , "Couldn't load boards.txt"
156
156
}
157
157
158
- if len (projectdata .BoardsTxtBoardIds ()) == 0 {
159
- return ruleresult .Skip , "boards.txt has no boards"
158
+ if len (projectdata .BoardsTxtVisibleBoardIds ()) == 0 {
159
+ return ruleresult .Skip , "boards.txt has no visible boards"
160
160
}
161
161
162
- nonCompliantBoardIDs := boardIDValueLTMinLength ( "build\\ .core" , compliancelevel .Specification )
162
+ nonCompliantBoardIDs := iDValueLTMinLength ( projectdata . BoardsTxtVisibleBoardIds (), "build\\ .core" , projectdata . BoardsTxtSchemaValidationResult ()[ compliancelevel .Specification ] )
163
163
164
164
if len (nonCompliantBoardIDs ) > 0 {
165
165
return ruleresult .Fail , strings .Join (nonCompliantBoardIDs , ", " )
@@ -202,7 +202,7 @@ func BoardsTxtBoardIDHideInvalid() (result ruleresult.Type, output string) {
202
202
return ruleresult .Skip , "boards.txt has no boards"
203
203
}
204
204
205
- nonCompliantBoardIDs := boardIDValueEnumMismatch ( "hide" , compliancelevel .Specification )
205
+ nonCompliantBoardIDs := iDValueEnumMismatch ( projectdata . BoardsTxtBoardIds (), "hide" , projectdata . BoardsTxtSchemaValidationResult ()[ compliancelevel .Specification ] )
206
206
207
207
if len (nonCompliantBoardIDs ) > 0 {
208
208
return ruleresult .Fail , strings .Join (nonCompliantBoardIDs , ", " )
@@ -245,7 +245,7 @@ func BoardsTxtBoardIDMenuMenuIDOptionIDLTMinLength() (result ruleresult.Type, ou
245
245
return ruleresult .Skip , "boards.txt has no boards"
246
246
}
247
247
248
- nonCompliantBoardIDs := boardIDValueLTMinLength ( "menu\\ .[^.]+\\ .[^.]+" , compliancelevel .Strict )
248
+ nonCompliantBoardIDs := iDValueLTMinLength ( projectdata . BoardsTxtBoardIds (), "menu\\ .[^.]+\\ .[^.]+" , projectdata . BoardsTxtSchemaValidationResult ()[ compliancelevel .Strict ] )
249
249
250
250
if len (nonCompliantBoardIDs ) > 0 {
251
251
return ruleresult .Fail , strings .Join (nonCompliantBoardIDs , ", " )
@@ -264,7 +264,7 @@ func BoardsTxtBoardIDSerialDisableDTRInvalid() (result ruleresult.Type, output s
264
264
return ruleresult .Skip , "boards.txt has no boards"
265
265
}
266
266
267
- nonCompliantBoardIDs := boardIDValueEnumMismatch ( "serial\\ .disableDTR" , compliancelevel .Specification )
267
+ nonCompliantBoardIDs := iDValueEnumMismatch ( projectdata . BoardsTxtBoardIds (), "serial\\ .disableDTR" , projectdata . BoardsTxtSchemaValidationResult ()[ compliancelevel .Specification ] )
268
268
269
269
if len (nonCompliantBoardIDs ) > 0 {
270
270
return ruleresult .Fail , strings .Join (nonCompliantBoardIDs , ", " )
@@ -283,7 +283,7 @@ func BoardsTxtBoardIDSerialDisableRTSInvalid() (result ruleresult.Type, output s
283
283
return ruleresult .Skip , "boards.txt has no boards"
284
284
}
285
285
286
- nonCompliantBoardIDs := boardIDValueEnumMismatch ( "serial\\ .disableRTS" , compliancelevel .Specification )
286
+ nonCompliantBoardIDs := iDValueEnumMismatch ( projectdata . BoardsTxtBoardIds (), "serial\\ .disableRTS" , projectdata . BoardsTxtSchemaValidationResult ()[ compliancelevel .Specification ] )
287
287
288
288
if len (nonCompliantBoardIDs ) > 0 {
289
289
return ruleresult .Fail , strings .Join (nonCompliantBoardIDs , ", " )
@@ -298,11 +298,11 @@ func BoardsTxtBoardIDUploadToolMissing() (result ruleresult.Type, output string)
298
298
return ruleresult .NotRun , "Couldn't load boards.txt"
299
299
}
300
300
301
- if len (projectdata .BoardsTxtBoardIds ()) == 0 {
302
- return ruleresult .Skip , "boards.txt has no boards"
301
+ if len (projectdata .BoardsTxtVisibleBoardIds ()) == 0 {
302
+ return ruleresult .Skip , "boards.txt has no visible boards"
303
303
}
304
304
305
- nonCompliantBoardIDs := boardIDMissingRequiredProperty ( "upload\\ .tool" , compliancelevel .Specification )
305
+ nonCompliantBoardIDs := iDMissingRequiredProperty ( projectdata . BoardsTxtVisibleBoardIds (), "upload\\ .tool" , projectdata . BoardsTxtSchemaValidationResult ()[ compliancelevel .Specification ] )
306
306
307
307
if len (nonCompliantBoardIDs ) > 0 {
308
308
return ruleresult .Fail , strings .Join (nonCompliantBoardIDs , ", " )
@@ -321,7 +321,7 @@ func BoardsTxtBoardIDUploadToolLTMinLength() (result ruleresult.Type, output str
321
321
return ruleresult .Skip , "boards.txt has no boards"
322
322
}
323
323
324
- nonCompliantBoardIDs := boardIDValueLTMinLength ( "upload\\ .tool" , compliancelevel .Specification )
324
+ nonCompliantBoardIDs := iDValueLTMinLength ( projectdata . BoardsTxtBoardIds (), "upload\\ .tool" , projectdata . BoardsTxtSchemaValidationResult ()[ compliancelevel .Specification ] )
325
325
326
326
if len (nonCompliantBoardIDs ) > 0 {
327
327
return ruleresult .Fail , strings .Join (nonCompliantBoardIDs , ", " )
@@ -336,11 +336,11 @@ func BoardsTxtBoardIDUploadMaximumSizeMissing() (result ruleresult.Type, output
336
336
return ruleresult .NotRun , "Couldn't load boards.txt"
337
337
}
338
338
339
- if len (projectdata .BoardsTxtBoardIds ()) == 0 {
340
- return ruleresult .Skip , "boards.txt has no boards"
339
+ if len (projectdata .BoardsTxtVisibleBoardIds ()) == 0 {
340
+ return ruleresult .Skip , "boards.txt has no visible boards"
341
341
}
342
342
343
- nonCompliantBoardIDs := boardIDMissingRequiredProperty ( "upload\\ .maximum_size" , compliancelevel .Strict )
343
+ nonCompliantBoardIDs := iDMissingRequiredProperty ( projectdata . BoardsTxtVisibleBoardIds (), "upload\\ .maximum_size" , projectdata . BoardsTxtSchemaValidationResult ()[ compliancelevel .Strict ] )
344
344
345
345
if len (nonCompliantBoardIDs ) > 0 {
346
346
return ruleresult .Fail , strings .Join (nonCompliantBoardIDs , ", " )
@@ -359,7 +359,7 @@ func BoardsTxtBoardIDUploadMaximumSizeInvalid() (result ruleresult.Type, output
359
359
return ruleresult .Skip , "boards.txt has no boards"
360
360
}
361
361
362
- nonCompliantBoardIDs := boardIDValuePatternMismatch ( "upload\\ .maximum_size" , compliancelevel .Specification )
362
+ nonCompliantBoardIDs := iDValuePatternMismatch ( projectdata . BoardsTxtBoardIds (), "upload\\ .maximum_size" , projectdata . BoardsTxtSchemaValidationResult ()[ compliancelevel .Specification ] )
363
363
364
364
if len (nonCompliantBoardIDs ) > 0 {
365
365
return ruleresult .Fail , strings .Join (nonCompliantBoardIDs , ", " )
@@ -374,11 +374,11 @@ func BoardsTxtBoardIDUploadMaximumDataSizeMissing() (result ruleresult.Type, out
374
374
return ruleresult .NotRun , "Couldn't load boards.txt"
375
375
}
376
376
377
- if len (projectdata .BoardsTxtBoardIds ()) == 0 {
378
- return ruleresult .Skip , "boards.txt has no boards"
377
+ if len (projectdata .BoardsTxtVisibleBoardIds ()) == 0 {
378
+ return ruleresult .Skip , "boards.txt has no visible boards"
379
379
}
380
380
381
- nonCompliantBoardIDs := boardIDMissingRequiredProperty ( "upload\\ .maximum_data_size" , compliancelevel .Strict )
381
+ nonCompliantBoardIDs := iDMissingRequiredProperty ( projectdata . BoardsTxtVisibleBoardIds (), "upload\\ .maximum_data_size" , projectdata . BoardsTxtSchemaValidationResult ()[ compliancelevel .Strict ] )
382
382
383
383
if len (nonCompliantBoardIDs ) > 0 {
384
384
return ruleresult .Fail , strings .Join (nonCompliantBoardIDs , ", " )
@@ -397,7 +397,7 @@ func BoardsTxtBoardIDUploadMaximumDataSizeInvalid() (result ruleresult.Type, out
397
397
return ruleresult .Skip , "boards.txt has no boards"
398
398
}
399
399
400
- nonCompliantBoardIDs := boardIDValuePatternMismatch ( "upload\\ .maximum_data_size" , compliancelevel .Specification )
400
+ nonCompliantBoardIDs := iDValuePatternMismatch ( projectdata . BoardsTxtBoardIds (), "upload\\ .maximum_data_size" , projectdata . BoardsTxtSchemaValidationResult ()[ compliancelevel .Specification ] )
401
401
402
402
if len (nonCompliantBoardIDs ) > 0 {
403
403
return ruleresult .Fail , strings .Join (nonCompliantBoardIDs , ", " )
@@ -416,7 +416,7 @@ func BoardsTxtBoardIDUploadUse1200bpsTouchInvalid() (result ruleresult.Type, out
416
416
return ruleresult .Skip , "boards.txt has no boards"
417
417
}
418
418
419
- nonCompliantBoardIDs := boardIDValueEnumMismatch ( "upload\\ .use_1200bps_touch" , compliancelevel .Specification )
419
+ nonCompliantBoardIDs := iDValueEnumMismatch ( projectdata . BoardsTxtBoardIds (), "upload\\ .use_1200bps_touch" , projectdata . BoardsTxtSchemaValidationResult ()[ compliancelevel .Specification ] )
420
420
421
421
if len (nonCompliantBoardIDs ) > 0 {
422
422
return ruleresult .Fail , strings .Join (nonCompliantBoardIDs , ", " )
@@ -435,7 +435,7 @@ func BoardsTxtBoardIDUploadWaitForUploadPortInvalid() (result ruleresult.Type, o
435
435
return ruleresult .Skip , "boards.txt has no boards"
436
436
}
437
437
438
- nonCompliantBoardIDs := boardIDValueEnumMismatch ( "upload\\ .wait_for_upload_port" , compliancelevel .Specification )
438
+ nonCompliantBoardIDs := iDValueEnumMismatch ( projectdata . BoardsTxtBoardIds (), "upload\\ .wait_for_upload_port" , projectdata . BoardsTxtSchemaValidationResult ()[ compliancelevel .Specification ] )
439
439
440
440
if len (nonCompliantBoardIDs ) > 0 {
441
441
return ruleresult .Fail , strings .Join (nonCompliantBoardIDs , ", " )
@@ -454,7 +454,7 @@ func BoardsTxtBoardIDVidNInvalid() (result ruleresult.Type, output string) {
454
454
return ruleresult .Skip , "boards.txt has no boards"
455
455
}
456
456
457
- nonCompliantBoardIDs := boardIDValuePatternMismatch ( "vid\\ .[0-9]+" , compliancelevel .Specification )
457
+ nonCompliantBoardIDs := iDValuePatternMismatch ( projectdata . BoardsTxtBoardIds (), "vid\\ .[0-9]+" , projectdata . BoardsTxtSchemaValidationResult ()[ compliancelevel .Specification ] )
458
458
459
459
if len (nonCompliantBoardIDs ) > 0 {
460
460
return ruleresult .Fail , strings .Join (nonCompliantBoardIDs , ", " )
@@ -473,7 +473,7 @@ func BoardsTxtBoardIDPidNInvalid() (result ruleresult.Type, output string) {
473
473
return ruleresult .Skip , "boards.txt has no boards"
474
474
}
475
475
476
- nonCompliantBoardIDs := boardIDValuePatternMismatch ( "pid\\ .[0-9]+" , compliancelevel .Specification )
476
+ nonCompliantBoardIDs := iDValuePatternMismatch ( projectdata . BoardsTxtBoardIds (), "pid\\ .[0-9]+" , projectdata . BoardsTxtSchemaValidationResult ()[ compliancelevel .Specification ] )
477
477
478
478
if len (nonCompliantBoardIDs ) > 0 {
479
479
return ruleresult .Fail , strings .Join (nonCompliantBoardIDs , ", " )
@@ -1760,26 +1760,6 @@ func PlatformTxtBootloaderPatternMissing() (result ruleresult.Type, output strin
1760
1760
return ruleresult .Pass , ""
1761
1761
}
1762
1762
1763
- // boardIDMissingRequiredProperty returns the list of board IDs missing the given required property.
1764
- func boardIDMissingRequiredProperty (propertyNameQuery string , complianceLevel compliancelevel.Type ) []string {
1765
- return iDMissingRequiredProperty (projectdata .BoardsTxtBoardIds (), propertyNameQuery , projectdata .BoardsTxtSchemaValidationResult ()[complianceLevel ])
1766
- }
1767
-
1768
- // boardIDValueLTMinLength returns the list of board IDs with value of the given property less than the minimum length.
1769
- func boardIDValueLTMinLength (propertyNameQuery string , complianceLevel compliancelevel.Type ) []string {
1770
- return iDValueLTMinLength (projectdata .BoardsTxtBoardIds (), propertyNameQuery , projectdata .BoardsTxtSchemaValidationResult ()[complianceLevel ])
1771
- }
1772
-
1773
- // boardIDValueEnumMismatch returns the list of board IDs with value of the given property not matching the JSON schema enum.
1774
- func boardIDValueEnumMismatch (propertyNameQuery string , complianceLevel compliancelevel.Type ) []string {
1775
- return iDValueEnumMismatch (projectdata .BoardsTxtBoardIds (), propertyNameQuery , projectdata .BoardsTxtSchemaValidationResult ()[complianceLevel ])
1776
- }
1777
-
1778
- // boardIDValueEnumMismatch returns the list of board IDs with value of the given property not matching the JSON schema pattern.
1779
- func boardIDValuePatternMismatch (propertyNameQuery string , complianceLevel compliancelevel.Type ) []string {
1780
- return iDValuePatternMismatch (projectdata .BoardsTxtBoardIds (), propertyNameQuery , projectdata .BoardsTxtSchemaValidationResult ()[complianceLevel ])
1781
- }
1782
-
1783
1763
// programmerIDMissingRequiredProperty returns the list of programmer IDs missing the given required property.
1784
1764
func programmerIDMissingRequiredProperty (propertyNameQuery string , complianceLevel compliancelevel.Type ) []string {
1785
1765
return iDMissingRequiredProperty (projectdata .ProgrammersTxtProgrammerIds (), propertyNameQuery , projectdata .ProgrammersTxtSchemaValidationResult ()[complianceLevel ])
0 commit comments