File tree 2 files changed +32
-0
lines changed
2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -686,6 +686,21 @@ var configurations = []Type{
686
686
ErrorModes : []checkmode.Type {checkmode .Default },
687
687
CheckFunction : checkfunctions .LibraryPropertiesDotALinkageFieldTrueWithFlatLayout ,
688
688
},
689
+ {
690
+ ProjectType : projecttype .Library ,
691
+ Category : "library.properties" ,
692
+ Subcategory : "includes field" ,
693
+ ID : "" ,
694
+ Brief : "includes blank" ,
695
+ Description : `Caused the "Sketch > Include library" feature of previous IDE versions to add an empty #include directive to the sketch.` ,
696
+ MessageTemplate : "Empty library.properties includes field. Please either define includes or remove this optional field. See https://arduino.github.io/arduino-cli/latest/library-specification/#libraryproperties-file-format" ,
697
+ DisableModes : nil ,
698
+ EnableModes : []checkmode.Type {checkmode .All },
699
+ InfoModes : nil ,
700
+ WarningModes : []checkmode.Type {checkmode .Permissive },
701
+ ErrorModes : []checkmode.Type {checkmode .Default },
702
+ CheckFunction : checkfunctions .LibraryPropertiesIncludesFieldLTMinLength ,
703
+ },
689
704
{
690
705
ProjectType : projecttype .Library ,
691
706
Category : "library.properties" ,
Original file line number Diff line number Diff line change @@ -706,6 +706,23 @@ func LibraryPropertiesDotALinkageFieldTrueWithFlatLayout() (result checkresult.T
706
706
return checkresult .Pass , ""
707
707
}
708
708
709
+ // LibraryPropertiesNameFieldLTMinLength checks if the library.properties "includes" value is less than the minimum length.
710
+ func LibraryPropertiesIncludesFieldLTMinLength () (result checkresult.Type , output string ) {
711
+ if checkdata .LibraryPropertiesLoadError () != nil {
712
+ return checkresult .NotRun , ""
713
+ }
714
+
715
+ if ! checkdata .LibraryProperties ().ContainsKey ("includes" ) {
716
+ return checkresult .NotRun , ""
717
+ }
718
+
719
+ if schema .PropertyLessThanMinLength ("includes" , checkdata .LibraryPropertiesSchemaValidationResult ()[compliancelevel .Specification ], configuration .SchemasPath ()) {
720
+ return checkresult .Fail , ""
721
+ }
722
+
723
+ return checkresult .Pass , ""
724
+ }
725
+
709
726
// LibraryPropertiesPrecompiledFieldEnabledWithFlatLayout checks whether a precompiled library has the required recursive layout type.
710
727
func LibraryPropertiesPrecompiledFieldEnabledWithFlatLayout () (result checkresult.Type , output string ) {
711
728
if checkdata .LoadedLibrary () == nil || checkdata .LibraryPropertiesLoadError () != nil {
You can’t perform that action at this time.
0 commit comments