Skip to content

Commit 1e00933

Browse files
authored
Merge pull request #74 from arduino/per1234/add-specification-strict-check-mode-handling
Use new compliance check modes in check configurations
2 parents caeb1d3 + 0389e1d commit 1e00933

File tree

2 files changed

+41
-33
lines changed

2 files changed

+41
-33
lines changed

Diff for: check/checkconfigurations/checkconfigurations.go

+33-33
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ var configurations = []Type{
6868
EnableModes: []checkmode.Type{checkmode.All},
6969
InfoModes: nil,
7070
WarningModes: []checkmode.Type{checkmode.Default},
71-
ErrorModes: []checkmode.Type{checkmode.LibraryManagerSubmission, checkmode.LibraryManagerIndexed},
71+
ErrorModes: []checkmode.Type{checkmode.LibraryManagerSubmission, checkmode.LibraryManagerIndexed, checkmode.Strict},
7272
CheckFunction: checkfunctions.LibraryPropertiesMissing,
7373
},
7474
{
@@ -187,8 +187,8 @@ var configurations = []Type{
187187
DisableModes: nil,
188188
EnableModes: []checkmode.Type{checkmode.All},
189189
InfoModes: nil,
190-
WarningModes: []checkmode.Type{checkmode.All},
191-
ErrorModes: nil,
190+
WarningModes: []checkmode.Type{checkmode.Default},
191+
ErrorModes: []checkmode.Type{checkmode.Strict},
192192
CheckFunction: checkfunctions.LibraryPropertiesNameFieldGTRecommendedLength,
193193
},
194194
{
@@ -217,8 +217,8 @@ var configurations = []Type{
217217
DisableModes: nil,
218218
EnableModes: []checkmode.Type{checkmode.All},
219219
InfoModes: nil,
220-
WarningModes: []checkmode.Type{checkmode.All},
221-
ErrorModes: nil,
220+
WarningModes: []checkmode.Type{checkmode.Default},
221+
ErrorModes: []checkmode.Type{checkmode.Strict},
222222
CheckFunction: checkfunctions.LibraryPropertiesNameFieldHasSpaces,
223223
},
224224
{
@@ -260,10 +260,10 @@ var configurations = []Type{
260260
Description: "Case insensitive",
261261
MessageTemplate: `Library name {{.}} contains "Arduino". This is superfluous.`,
262262
DisableModes: []checkmode.Type{checkmode.Official},
263-
EnableModes: []checkmode.Type{checkmode.All},
263+
EnableModes: []checkmode.Type{checkmode.Default},
264264
InfoModes: nil,
265-
WarningModes: []checkmode.Type{checkmode.All},
266-
ErrorModes: nil,
265+
WarningModes: []checkmode.Type{checkmode.Default},
266+
ErrorModes: []checkmode.Type{checkmode.Strict},
267267
CheckFunction: checkfunctions.LibraryPropertiesNameFieldContainsArduino,
268268
},
269269
{
@@ -277,8 +277,8 @@ var configurations = []Type{
277277
DisableModes: nil,
278278
EnableModes: []checkmode.Type{checkmode.All},
279279
InfoModes: nil,
280-
WarningModes: []checkmode.Type{checkmode.All},
281-
ErrorModes: nil,
280+
WarningModes: []checkmode.Type{checkmode.Default},
281+
ErrorModes: []checkmode.Type{checkmode.Strict},
282282
CheckFunction: checkfunctions.LibraryPropertiesNameFieldContainsLibrary,
283283
},
284284
{
@@ -367,8 +367,8 @@ var configurations = []Type{
367367
DisableModes: nil,
368368
EnableModes: []checkmode.Type{checkmode.All},
369369
InfoModes: nil,
370-
WarningModes: []checkmode.Type{checkmode.All},
371-
ErrorModes: nil,
370+
WarningModes: []checkmode.Type{checkmode.Default},
371+
ErrorModes: []checkmode.Type{checkmode.Strict},
372372
CheckFunction: checkfunctions.LibraryPropertiesVersionFieldNonSemver,
373373
},
374374
{
@@ -442,8 +442,8 @@ var configurations = []Type{
442442
DisableModes: []checkmode.Type{checkmode.Official},
443443
EnableModes: []checkmode.Type{checkmode.Default},
444444
InfoModes: nil,
445-
WarningModes: []checkmode.Type{checkmode.All},
446-
ErrorModes: nil,
445+
WarningModes: []checkmode.Type{checkmode.Default},
446+
ErrorModes: []checkmode.Type{checkmode.Strict},
447447
CheckFunction: checkfunctions.LibraryPropertiesMaintainerFieldStartsWithArduino,
448448
},
449449
{
@@ -487,8 +487,8 @@ var configurations = []Type{
487487
DisableModes: []checkmode.Type{checkmode.Official},
488488
EnableModes: []checkmode.Type{checkmode.Default},
489489
InfoModes: nil,
490-
WarningModes: []checkmode.Type{checkmode.All},
491-
ErrorModes: nil,
490+
WarningModes: []checkmode.Type{checkmode.Default},
491+
ErrorModes: []checkmode.Type{checkmode.Strict},
492492
CheckFunction: checkfunctions.LibraryPropertiesEmailFieldStartsWithArduino,
493493
},
494494
{
@@ -577,8 +577,8 @@ var configurations = []Type{
577577
DisableModes: nil,
578578
EnableModes: []checkmode.Type{checkmode.All},
579579
InfoModes: nil,
580-
WarningModes: []checkmode.Type{checkmode.All},
581-
ErrorModes: nil,
580+
WarningModes: []checkmode.Type{checkmode.Default},
581+
ErrorModes: []checkmode.Type{checkmode.Strict},
582582
CheckFunction: checkfunctions.LibraryPropertiesParagraphFieldRepeatsSentence,
583583
},
584584
{
@@ -592,8 +592,8 @@ var configurations = []Type{
592592
DisableModes: nil,
593593
EnableModes: []checkmode.Type{checkmode.All},
594594
InfoModes: nil,
595-
WarningModes: []checkmode.Type{checkmode.All},
596-
ErrorModes: nil,
595+
WarningModes: []checkmode.Type{checkmode.Default},
596+
ErrorModes: []checkmode.Type{checkmode.Strict},
597597
CheckFunction: checkfunctions.LibraryPropertiesCategoryFieldMissing,
598598
},
599599
{
@@ -622,8 +622,8 @@ var configurations = []Type{
622622
DisableModes: nil,
623623
EnableModes: []checkmode.Type{checkmode.All},
624624
InfoModes: nil,
625-
WarningModes: []checkmode.Type{checkmode.All},
626-
ErrorModes: nil,
625+
WarningModes: []checkmode.Type{checkmode.Default},
626+
ErrorModes: []checkmode.Type{checkmode.Strict},
627627
CheckFunction: checkfunctions.LibraryPropertiesCategoryFieldUncategorized,
628628
},
629629
{
@@ -667,8 +667,8 @@ var configurations = []Type{
667667
DisableModes: nil,
668668
EnableModes: []checkmode.Type{checkmode.All},
669669
InfoModes: nil,
670-
WarningModes: []checkmode.Type{checkmode.All},
671-
ErrorModes: nil,
670+
WarningModes: []checkmode.Type{checkmode.Default},
671+
ErrorModes: []checkmode.Type{checkmode.Strict},
672672
CheckFunction: checkfunctions.LibraryPropertiesUrlFieldDeadLink,
673673
},
674674
{
@@ -682,8 +682,8 @@ var configurations = []Type{
682682
DisableModes: nil,
683683
EnableModes: []checkmode.Type{checkmode.All},
684684
InfoModes: nil,
685-
WarningModes: []checkmode.Type{checkmode.All},
686-
ErrorModes: nil,
685+
WarningModes: []checkmode.Type{checkmode.Default},
686+
ErrorModes: []checkmode.Type{checkmode.Strict},
687687
CheckFunction: checkfunctions.LibraryPropertiesArchitecturesFieldMissing,
688688
},
689689
{
@@ -847,8 +847,8 @@ var configurations = []Type{
847847
DisableModes: nil,
848848
EnableModes: []checkmode.Type{checkmode.All},
849849
InfoModes: nil,
850-
WarningModes: []checkmode.Type{checkmode.All},
851-
ErrorModes: nil,
850+
WarningModes: []checkmode.Type{checkmode.Default},
851+
ErrorModes: []checkmode.Type{checkmode.Strict},
852852
CheckFunction: checkfunctions.LibraryPropertiesMisspelledOptionalField,
853853
},
854854
{
@@ -908,7 +908,7 @@ var configurations = []Type{
908908
EnableModes: []checkmode.Type{checkmode.All},
909909
InfoModes: nil,
910910
WarningModes: []checkmode.Type{checkmode.Default},
911-
ErrorModes: []checkmode.Type{checkmode.LibraryManagerSubmission, checkmode.LibraryManagerIndexed},
911+
ErrorModes: []checkmode.Type{checkmode.LibraryManagerSubmission, checkmode.LibraryManagerIndexed, checkmode.Strict},
912912
CheckFunction: checkfunctions.LibraryHasDotDevelopmentFile,
913913
},
914914
{
@@ -922,7 +922,7 @@ var configurations = []Type{
922922
DisableModes: nil,
923923
EnableModes: []checkmode.Type{checkmode.All},
924924
InfoModes: nil,
925-
WarningModes: []checkmode.Type{checkmode.LibraryManagerSubmission, checkmode.LibraryManagerIndexed},
925+
WarningModes: []checkmode.Type{checkmode.LibraryManagerSubmission, checkmode.LibraryManagerIndexed, checkmode.Strict},
926926
ErrorModes: nil,
927927
CheckFunction: checkfunctions.LibraryHasExe,
928928
},
@@ -1013,7 +1013,7 @@ var configurations = []Type{
10131013
EnableModes: []checkmode.Type{checkmode.All},
10141014
InfoModes: nil,
10151015
WarningModes: []checkmode.Type{checkmode.All},
1016-
ErrorModes: nil,
1016+
ErrorModes: []checkmode.Type{checkmode.Strict},
10171017
CheckFunction: checkfunctions.MisspelledExtrasFolderName,
10181018
},
10191019
{
@@ -1057,8 +1057,8 @@ var configurations = []Type{
10571057
DisableModes: nil,
10581058
EnableModes: []checkmode.Type{checkmode.All},
10591059
InfoModes: nil,
1060-
WarningModes: []checkmode.Type{checkmode.Permissive},
1061-
ErrorModes: []checkmode.Type{checkmode.Default},
1060+
WarningModes: []checkmode.Type{checkmode.Default},
1061+
ErrorModes: []checkmode.Type{checkmode.Strict},
10621062
CheckFunction: checkfunctions.PdeSketchExtension,
10631063
},
10641064
}

Diff for: configuration/defaults.go

+8
Original file line numberDiff line numberDiff line change
@@ -26,24 +26,32 @@ import (
2626
// Subprojects use the same check modes as the superproject.
2727
var defaultCheckModes = map[projecttype.Type]map[checkmode.Type]bool{
2828
projecttype.Sketch: {
29+
checkmode.Strict: false,
30+
checkmode.Specification: true,
2931
checkmode.Permissive: false,
3032
checkmode.LibraryManagerSubmission: false,
3133
checkmode.LibraryManagerIndexed: false,
3234
checkmode.Official: false,
3335
},
3436
projecttype.Library: {
37+
checkmode.Strict: false,
38+
checkmode.Specification: true,
3539
checkmode.Permissive: false,
3640
checkmode.LibraryManagerSubmission: true,
3741
checkmode.LibraryManagerIndexed: false,
3842
checkmode.Official: false,
3943
},
4044
projecttype.Platform: {
45+
checkmode.Strict: false,
46+
checkmode.Specification: true,
4147
checkmode.Permissive: false,
4248
checkmode.LibraryManagerSubmission: false,
4349
checkmode.LibraryManagerIndexed: false,
4450
checkmode.Official: false,
4551
},
4652
projecttype.PackageIndex: {
53+
checkmode.Strict: false,
54+
checkmode.Specification: true,
4755
checkmode.Permissive: false,
4856
checkmode.LibraryManagerSubmission: false,
4957
checkmode.LibraryManagerIndexed: false,

0 commit comments

Comments
 (0)