-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
ruleconfiguration.go
5417 lines (5412 loc) · 276 KB
/
ruleconfiguration.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// This file is part of Arduino Lint.
//
// Copyright 2020 ARDUINO SA (http://www.arduino.cc/)
//
// This software is released under the GNU General Public License, either
// version 3 of the License, or (at your option) any later version.
// This license covers the main part of Arduino Lint.
// The terms of this license can be found at:
// https://www.gnu.org/licenses/gpl-3.0.en.html
//
// You can be released from the requirements of the above licenses by purchasing
// a commercial license. Buying such a license is mandatory if you want to
// modify or otherwise use the software for commercial activities involving the
// Arduino software without disclosing the source code of your own applications.
// To purchase a commercial license, send an email to license@arduino.cc.
/*
Package ruleconfiguration defines the configuration of each rule:
- metadata
- output template
- under which conditions it's enabled
- the level of a failure
- which function implements it
*/
package ruleconfiguration
import (
"github.com/arduino/arduino-lint/internal/configuration/rulemode"
"github.com/arduino/arduino-lint/internal/project/projecttype"
"github.com/arduino/arduino-lint/internal/rule/rulefunction"
)
// Type is the type for rule configurations.
type Type struct {
ProjectType projecttype.Type // The project type the rule applies to.
SuperprojectType projecttype.Type // The superproject type requirement for the rule.
// The following fields provide arbitrary text for the tool output associated with each rule:
Category string
Subcategory string
ID string // Unique rule identifier: <project type identifier (L|S|P|I)><category identifier><number>
Brief string // Short description of the rule.
Description string // Verbose description of the rule.
MessageTemplate string // The warning/error message template displayed when the rule is violated. Will be filled by rule function output.
Reference string // URL to visit for more information about the rule subject.
// The following fields define under which tool configuration modes the rule will run:
DisableModes []rulemode.Type // Rule is disabled when tool is in any of these modes.
EnableModes []rulemode.Type // Rule is only enabled when tool is in one of these modes.
// The following fields define the rule level in each configuration mode:
InfoModes []rulemode.Type // Failure of the rule only results in an informational message.
WarningModes []rulemode.Type // Failure of the rule is considered a warning.
ErrorModes []rulemode.Type // Failure of the rule is considered an error.
RuleFunction rulefunction.Type // The function that implements the rule.
}
// Configurations returns the slice of rule configurations.
func Configurations() []Type {
return configurations
}
// configurations is an array of structs that define the configuration of each rule.
var configurations = []Type{
{
ProjectType: projecttype.Library,
SuperprojectType: projecttype.All,
Category: "structure",
Subcategory: "general",
ID: "LS001",
Brief: "invalid library",
Description: "The path does not contain a valid Arduino library.",
MessageTemplate: "Path does not contain a valid Arduino library.",
Reference: "https://arduino.github.io/arduino-cli/latest/library-specification",
DisableModes: nil,
EnableModes: []rulemode.Type{rulemode.Default},
InfoModes: nil,
WarningModes: nil,
ErrorModes: []rulemode.Type{rulemode.Default},
RuleFunction: rulefunction.LibraryInvalid,
},
{
ProjectType: projecttype.Library,
SuperprojectType: projecttype.All,
Category: "structure",
Subcategory: "root folder",
ID: "LS002",
Brief: "folder name too long",
Description: "The library root folder name exceeds the maximum length supported by the Arduino development tools. This will be problematic for people doing manual installation of the library.",
MessageTemplate: "Folder name {{.}} exceeds maximum length.",
Reference: "https://arduino.github.io/arduino-cli/latest/library-specification/#library-root-folder",
DisableModes: nil,
EnableModes: []rulemode.Type{rulemode.Default},
InfoModes: nil,
WarningModes: []rulemode.Type{rulemode.Permissive},
ErrorModes: []rulemode.Type{rulemode.Default},
RuleFunction: rulefunction.LibraryFolderNameGTMaxLength,
},
{
ProjectType: projecttype.Library,
SuperprojectType: projecttype.All,
Category: "structure",
Subcategory: "root folder",
ID: "LS003",
Brief: "prohibited character in folder name",
Description: "The library root folder name contains prohibited characters. This will be problematic for people doing manual installation of the library.",
MessageTemplate: "Prohibited character(s) in folder name: {{.}}",
Reference: "https://arduino.github.io/arduino-cli/latest/library-specification/#library-root-folder",
DisableModes: nil,
EnableModes: []rulemode.Type{rulemode.Default},
InfoModes: nil,
WarningModes: []rulemode.Type{rulemode.Permissive},
ErrorModes: []rulemode.Type{rulemode.Default},
RuleFunction: rulefunction.ProhibitedCharactersInLibraryFolderName,
},
{
ProjectType: projecttype.Library,
SuperprojectType: projecttype.Library,
Category: "structure",
Subcategory: "miscellaneous",
ID: "LS004",
Brief: "submodule",
Description: `A [Git submodule](https://git-scm.com/book/en/v2/Git-Tools-Submodules) was found under the library folder. Library Manager installations and installations of libraries downloaded via GitHub's "Download ZIP" feature will only contain an empty folder in place of the submodule.`,
MessageTemplate: `Git submodule detected. Library Manager installations and installations from GitHub's "Download ZIP" will only contain an empty folder in place of the submodule.`,
Reference: "",
DisableModes: nil,
EnableModes: []rulemode.Type{rulemode.Default},
InfoModes: nil,
WarningModes: []rulemode.Type{rulemode.Default},
ErrorModes: nil,
RuleFunction: rulefunction.LibraryHasSubmodule,
},
{
ProjectType: projecttype.Library,
SuperprojectType: projecttype.All,
Category: "structure",
Subcategory: "miscellaneous",
ID: "LS005",
Brief: "symlink",
Description: "A symlink was found under the library folder. Symlinks cause difficulties for Windows users due to restrictions on their use. The presence of a symlink blocks addition to the Arduino Library Manager index.",
MessageTemplate: "Symlink(s) found. Symlinks cause difficulties for Windows users. These block addition to the Arduino Library Manager index:\n{{.}}",
Reference: "",
DisableModes: nil,
EnableModes: []rulemode.Type{rulemode.Default},
InfoModes: nil,
WarningModes: []rulemode.Type{rulemode.Default},
ErrorModes: []rulemode.Type{rulemode.LibraryManagerSubmission, rulemode.LibraryManagerIndexed, rulemode.LibraryManagerIndexing},
RuleFunction: rulefunction.LibraryContainsSymlinks,
},
{
ProjectType: projecttype.Library,
SuperprojectType: projecttype.All,
Category: "structure",
Subcategory: "miscellaneous",
ID: "LS006",
Brief: ".development file",
Description: "A `.development` file was found in the library root folder. Presence of this file blocks addition to the Library Manager index.",
MessageTemplate: ".development flag file found. This file allows users to accidentally modify examples. Presence of this file blocks addition to the Library Manager index.",
Reference: "https://arduino.github.io/arduino-cli/latest/library-specification/#development-flag-file",
DisableModes: nil,
EnableModes: []rulemode.Type{rulemode.Default},
InfoModes: nil,
WarningModes: []rulemode.Type{rulemode.Default},
ErrorModes: []rulemode.Type{rulemode.LibraryManagerSubmission, rulemode.LibraryManagerIndexed, rulemode.LibraryManagerIndexing, rulemode.Strict},
RuleFunction: rulefunction.LibraryHasDotDevelopmentFile,
},
{
ProjectType: projecttype.Library,
SuperprojectType: projecttype.Library,
Category: "structure",
Subcategory: "miscellaneous",
ID: "LS007",
Brief: ".exe file",
Description: "A file with `.exe` file extension was found under the library folder. Presence of this file blocks addition to the Library Manager index.",
MessageTemplate: ".exe file(s) found. Presence of these files blocks addition to the Library Manager index:\n{{.}}",
Reference: "",
DisableModes: []rulemode.Type{rulemode.Default},
EnableModes: []rulemode.Type{rulemode.LibraryManagerSubmission, rulemode.LibraryManagerIndexed, rulemode.LibraryManagerIndexing},
InfoModes: nil,
WarningModes: nil,
ErrorModes: []rulemode.Type{rulemode.Default},
RuleFunction: rulefunction.LibraryHasExe,
},
{
ProjectType: projecttype.Library,
SuperprojectType: projecttype.All,
Category: "structure",
Subcategory: "source code",
ID: "LS008",
Brief: "name-header mismatch",
Description: "The match between the `library.properties` `name` field and the filename in an `#include` directive is a factor in the library's [dependency resolution priority](https://arduino.github.io/arduino-cli/latest/sketch-build-process/#dependency-resolution). It's recommended for the primary header filename to match the library name.",
MessageTemplate: "No header file found matching library name ({{.}}). Best practices are for primary header filename to match library name.",
Reference: "https://arduino.github.io/arduino-cli/latest/library-specification/#libraryproperties-file-format",
DisableModes: nil,
EnableModes: []rulemode.Type{rulemode.Default},
InfoModes: []rulemode.Type{rulemode.Permissive},
WarningModes: []rulemode.Type{rulemode.Default},
ErrorModes: nil,
RuleFunction: rulefunction.LibraryPropertiesNameFieldHeaderMismatch,
},
{
ProjectType: projecttype.Library,
SuperprojectType: projecttype.All,
Category: "structure",
Subcategory: "source code",
ID: "LS009",
Brief: "src folder case",
Description: "The library's source subfolder name has incorrect case. This folder must be named exactly `src` in order for the library to work on case sensitive file systems (e.g., Linux).",
MessageTemplate: "Incorrect src folder name case: {{.}}. This will cause the library to not be recognized on case-sensitive file systems.",
Reference: "https://arduino.github.io/arduino-cli/latest/library-specification/#library-root-folder",
DisableModes: nil,
EnableModes: []rulemode.Type{rulemode.Default},
InfoModes: nil,
WarningModes: nil,
ErrorModes: []rulemode.Type{rulemode.Default},
RuleFunction: rulefunction.IncorrectLibrarySrcFolderNameCase,
},
{
ProjectType: projecttype.Library,
SuperprojectType: projecttype.All,
Category: "structure",
Subcategory: "source code",
ID: "LS010",
Brief: "recursive with utility folder",
Description: "A library with \"1.5 format\" (recursive layout) contains a subfolder named `utility`. Although the `utility` folder has special treatment in libraries with the old \"1.5 format\" (flat layout), it is not supported in libraries of the new layout.",
MessageTemplate: `Utility folder found in "1.5" format library. Compilation of this folder is only supported on "1.0" format libraries.`,
Reference: "https://arduino.github.io/arduino-cli/latest/library-specification/#source-code",
DisableModes: nil,
EnableModes: []rulemode.Type{rulemode.Default},
InfoModes: nil,
WarningModes: []rulemode.Type{rulemode.Permissive},
ErrorModes: []rulemode.Type{rulemode.Default},
RuleFunction: rulefunction.RecursiveLibraryWithUtilityFolder,
},
{
ProjectType: projecttype.Library,
SuperprojectType: projecttype.All,
Category: "structure",
Subcategory: "extras folder",
ID: "LS011",
Brief: "incorrect extras folder name",
Description: "A subfolder was found under the library root with a name similar to `extras`. The `extras` subfolder has been designated as the location for any supplemental files for the library. The name must be spelled exactly `extras`.",
MessageTemplate: "Potentially misspelled extras folder name found: {{.}}",
Reference: "https://arduino.github.io/arduino-cli/latest/library-specification/#extra-documentation",
DisableModes: nil,
EnableModes: []rulemode.Type{rulemode.Default},
InfoModes: nil,
WarningModes: []rulemode.Type{rulemode.Default},
ErrorModes: []rulemode.Type{rulemode.Strict},
RuleFunction: rulefunction.MisspelledExtrasFolderName,
},
{
ProjectType: projecttype.Library,
SuperprojectType: projecttype.All,
Category: "structure",
Subcategory: "extras folder",
ID: "LS012",
Brief: "extras folder name case",
Description: "The library's extras subfolder name has incorrect case. The `extras` subfolder has been designated as the location for any supplemental files for the library. The folder name must be spelled exactly `extras`",
MessageTemplate: "Incorrect extras folder name case: {{.}}",
Reference: "https://arduino.github.io/arduino-cli/latest/library-specification/#extra-documentation",
DisableModes: nil,
EnableModes: []rulemode.Type{rulemode.Default},
InfoModes: nil,
WarningModes: []rulemode.Type{rulemode.Permissive},
ErrorModes: []rulemode.Type{rulemode.Default},
RuleFunction: rulefunction.IncorrectExtrasFolderNameCase,
},
{
ProjectType: projecttype.Library,
SuperprojectType: projecttype.All,
Category: "library.properties",
Subcategory: "general",
ID: "LP001",
Brief: "missing library.properties",
Description: "The `library.properties` file provides metadata for Arduino libraries. Although not required for 1.0 format libraries (AKA \"legacy\") which are not in the Library Manager index, this metadata is useful, hence recommended.",
MessageTemplate: "Library has no library.properties metadata file. This file provides useful information and is required for admission to the Library Manager index.",
Reference: "https://arduino.github.io/arduino-cli/latest/library-specification/#library-metadata",
DisableModes: nil,
EnableModes: []rulemode.Type{rulemode.Default},
InfoModes: nil,
WarningModes: []rulemode.Type{rulemode.Default},
ErrorModes: []rulemode.Type{rulemode.LibraryManagerSubmission, rulemode.LibraryManagerIndexed, rulemode.LibraryManagerIndexing, rulemode.Strict},
RuleFunction: rulefunction.LibraryPropertiesMissing,
},
{
ProjectType: projecttype.Library,
SuperprojectType: projecttype.All,
Category: "library.properties",
Subcategory: "general",
ID: "LP002",
Brief: "incorrect library.properties file name",
Description: "A file was found under the library root with a name similar to `library.properties`. The `library.properties` file provides metadata for Arduino libraries. The file name must be spelled exactly `library.properties`",
MessageTemplate: "Incorrectly spelled library.properties file name found: {{.}}",
Reference: "https://arduino.github.io/arduino-cli/latest/library-specification/#library-metadata",
DisableModes: nil,
EnableModes: []rulemode.Type{rulemode.Default},
InfoModes: nil,
WarningModes: []rulemode.Type{rulemode.Default},
ErrorModes: []rulemode.Type{rulemode.Strict},
RuleFunction: rulefunction.MisspelledLibraryPropertiesFileName,
},
{
ProjectType: projecttype.Library,
SuperprojectType: projecttype.All,
Category: "library.properties",
Subcategory: "general",
ID: "LP003",
Brief: "library.properties file name case",
Description: "The library's metadata file has incorrect case. This causes \"1.5\" format (AKA \"recursive layout\") libraries to not be recognized on case-sensitive file systems. The file name must be spelled exactly `library.properties`",
MessageTemplate: "Incorrect library.properties file name case: {{.}}",
Reference: "https://arduino.github.io/arduino-cli/latest/library-specification/#library-metadata",
DisableModes: nil,
EnableModes: []rulemode.Type{rulemode.Default},
InfoModes: nil,
WarningModes: nil,
ErrorModes: []rulemode.Type{rulemode.Default},
RuleFunction: rulefunction.IncorrectLibraryPropertiesFileNameCase,
},
{
ProjectType: projecttype.Library,
SuperprojectType: projecttype.All,
Category: "library.properties",
Subcategory: "general",
ID: "LP004",
Brief: "redundant library.properties",
Description: "The library contains a `library.properties` file in a subfolder. Only the file in the root of the library is used by the Arduino development tools for library metadata. Superfluous `library.properties` files can result in confusion or unnecessary maintenance effort.",
MessageTemplate: "Redundant library.properties file found at {{.}}. Only the file in the root of the library is used.",
Reference: "https://arduino.github.io/arduino-cli/latest/library-specification/#library-metadata",
DisableModes: nil,
EnableModes: []rulemode.Type{rulemode.Default},
InfoModes: nil,
WarningModes: []rulemode.Type{rulemode.Permissive},
ErrorModes: []rulemode.Type{rulemode.Default},
RuleFunction: rulefunction.RedundantLibraryProperties,
},
{
ProjectType: projecttype.Library,
SuperprojectType: projecttype.All,
Category: "library.properties",
Subcategory: "general",
ID: "LP005",
Brief: "library.properties format",
Description: "The `library.properties` file provides metadata for Arduino libraries. This file has a specific format that must be followed in order for the library to be valid.",
MessageTemplate: "library.properties has an invalid format: {{.}}",
Reference: "https://arduino.github.io/arduino-cli/latest/library-specification/#libraryproperties-file-format",
DisableModes: nil,
EnableModes: []rulemode.Type{rulemode.Default},
InfoModes: nil,
WarningModes: nil,
ErrorModes: []rulemode.Type{rulemode.Default},
RuleFunction: rulefunction.LibraryPropertiesFormat,
},
{
ProjectType: projecttype.Library,
SuperprojectType: projecttype.All,
Category: "library.properties",
Subcategory: "general",
ID: "LP006",
Brief: "misspelled library.properties field",
Description: "A field was found in the `library.properties` metadata file with a name similar, but not matching, one of the standard fields.",
MessageTemplate: "Potentially misspelled library.properties field name detected.",
Reference: "https://arduino.github.io/arduino-cli/latest/library-specification/#libraryproperties-file-format",
DisableModes: nil,
EnableModes: []rulemode.Type{rulemode.Default},
InfoModes: nil,
WarningModes: []rulemode.Type{rulemode.Default},
ErrorModes: []rulemode.Type{rulemode.Strict},
RuleFunction: rulefunction.LibraryPropertiesMisspelledOptionalField,
},
{
ProjectType: projecttype.Library,
SuperprojectType: projecttype.All,
Category: "library.properties",
Subcategory: "name field",
ID: "LP007",
Brief: "missing name",
Description: "The `name` field is missing from the library's `library.properties` metadata file.",
MessageTemplate: "Missing name field in library.properties",
Reference: "https://arduino.github.io/arduino-cli/latest/library-specification/#libraryproperties-file-format",
DisableModes: nil,
EnableModes: []rulemode.Type{rulemode.Default},
InfoModes: nil,
WarningModes: nil,
ErrorModes: []rulemode.Type{rulemode.Default},
RuleFunction: rulefunction.LibraryPropertiesNameFieldMissing,
},
{
ProjectType: projecttype.Library,
SuperprojectType: projecttype.All,
Category: "library.properties",
Subcategory: "name field",
ID: "LP008",
Brief: "name < min length",
Description: "The `name` field in the library's `library.properties` metadata file is shorter than the minimum length.",
MessageTemplate: "library.properties name value is less than minimum length.",
Reference: "https://arduino.github.io/arduino-cli/latest/library-specification/#libraryproperties-file-format",
DisableModes: nil,
EnableModes: []rulemode.Type{rulemode.Default},
InfoModes: nil,
WarningModes: nil,
ErrorModes: []rulemode.Type{rulemode.Default},
RuleFunction: rulefunction.LibraryPropertiesNameFieldLTMinLength,
},
{
ProjectType: projecttype.Library,
SuperprojectType: projecttype.All,
Category: "library.properties",
Subcategory: "name field",
ID: "LP009",
Brief: "name > max length",
Description: "The `name` field in the library's `library.properties` metadata file is greater than the maximum length.",
MessageTemplate: "library.properties name value {{.}} is longer than maximum length.",
Reference: "https://arduino.github.io/arduino-cli/latest/library-specification/#libraryproperties-file-format",
DisableModes: nil,
EnableModes: []rulemode.Type{rulemode.Default},
InfoModes: nil,
WarningModes: nil,
ErrorModes: []rulemode.Type{rulemode.Default},
RuleFunction: rulefunction.LibraryPropertiesNameFieldGTMaxLength,
},
{
ProjectType: projecttype.Library,
SuperprojectType: projecttype.All,
Category: "library.properties",
Subcategory: "name field",
ID: "LP010",
Brief: "name > recommended length",
Description: "The `name` field in the library's `library.properties` metadata file is longer than the recommended length. As the unique identifier for the library, the name will be typed by the users of command line tools (e.g., `arduino-cli lib install Servo`). For this reason, it is best practices to avoid unnecessary name length.",
MessageTemplate: "library.properties name value {{.}} is longer than the recommended length of 32 characters.",
Reference: "https://arduino.github.io/arduino-cli/latest/library-specification/#libraryproperties-file-format",
DisableModes: nil,
EnableModes: []rulemode.Type{rulemode.Default},
InfoModes: nil,
WarningModes: []rulemode.Type{rulemode.Default},
ErrorModes: []rulemode.Type{rulemode.Strict},
RuleFunction: rulefunction.LibraryPropertiesNameFieldGTRecommendedLength,
},
{
ProjectType: projecttype.Library,
SuperprojectType: projecttype.All,
Category: "library.properties",
Subcategory: "name field",
ID: "LP011",
Brief: "prohibited character in name",
Description: "The `name` field in the library's `library.properties` metadata file contains a prohibited character.",
MessageTemplate: "Prohibited character(s) in library.properties name value: {{.}}",
Reference: "https://arduino.github.io/arduino-cli/latest/library-specification/#libraryproperties-file-format",
DisableModes: nil,
EnableModes: []rulemode.Type{rulemode.Default},
InfoModes: nil,
WarningModes: nil,
ErrorModes: []rulemode.Type{rulemode.Default},
RuleFunction: rulefunction.LibraryPropertiesNameFieldDisallowedCharacters,
},
{
ProjectType: projecttype.Library,
SuperprojectType: projecttype.Library,
Category: "library.properties",
Subcategory: "name field",
ID: "LP012",
Brief: `name starts with "Arduino"`,
Description: "The `name` field in the library's `library.properties` metadata file starts with \"Arduino\" (case insensitive). Libraries with this name prefix are only allowed in Library Manager under one of the following conditions:\n\n- official libraries\n- 3rd party libraries added to the Library Manager index prior to the enactment of this rule\n\nIf the former, configure Arduino Lint in [\"official\" mode](https://arduino.github.io/arduino-lint/latest/#environment-variables).\nIf the latter, use [the `--library-manager=update` flag](https://arduino.github.io/arduino-lint/latest/commands/arduino-lint/#options)",
MessageTemplate: `Library name {{.}} starts with "Arduino". These names are reserved for official libraries.`,
Reference: "https://arduino.github.io/arduino-cli/latest/library-specification/#libraryproperties-file-format",
DisableModes: []rulemode.Type{rulemode.Official},
EnableModes: []rulemode.Type{rulemode.Default},
InfoModes: nil,
WarningModes: []rulemode.Type{rulemode.Default},
ErrorModes: []rulemode.Type{rulemode.LibraryManagerSubmission, rulemode.Strict},
RuleFunction: rulefunction.LibraryPropertiesNameFieldStartsWithArduino,
},
{
ProjectType: projecttype.Library,
SuperprojectType: projecttype.Library,
Category: "library.properties",
Subcategory: "name field",
ID: "LP013",
Brief: "name missing official prefix",
Description: "The `name` field in the library's `library.properties` metadata file is missing the \"Arduino_\" prefix. The names of all new official libraries must have this prefix.",
MessageTemplate: `Library name {{.}} is missing the "Arduino_" prefix. The names of all new official libraries must have this prefix.`,
Reference: "https://arduino.github.io/arduino-cli/latest/library-specification/#libraryproperties-file-format",
DisableModes: []rulemode.Type{rulemode.Default},
EnableModes: []rulemode.Type{rulemode.Official},
InfoModes: nil,
WarningModes: []rulemode.Type{rulemode.Default},
ErrorModes: []rulemode.Type{rulemode.Strict},
RuleFunction: rulefunction.LibraryPropertiesNameFieldMissingOfficialPrefix,
},
{
ProjectType: projecttype.Library,
SuperprojectType: projecttype.All,
Category: "library.properties",
Subcategory: "name field",
ID: "LP014",
Brief: `name contains "Arduino"`,
Description: "The `name` field in the library's `library.properties` metadata file contains \"Arduino\" (case insensitive). This is usually implicit, only adding unnecessary length to the name.",
MessageTemplate: `Library name {{.}} contains "Arduino". This is superfluous.`,
Reference: "https://arduino.github.io/arduino-cli/latest/library-specification/#libraryproperties-file-format",
DisableModes: []rulemode.Type{rulemode.Official},
EnableModes: []rulemode.Type{rulemode.Default},
InfoModes: nil,
WarningModes: []rulemode.Type{rulemode.Default},
ErrorModes: []rulemode.Type{rulemode.Strict},
RuleFunction: rulefunction.LibraryPropertiesNameFieldContainsArduino,
},
{
ProjectType: projecttype.Library,
SuperprojectType: projecttype.All,
Category: "library.properties",
Subcategory: "name field",
ID: "LP015",
Brief: "name contains spaces",
Description: "The `name` field in the library's `library.properties` metadata file contains spaces. It's recommended that the name value, installation folder, and primary header filename all match. Since spaces are not allowed in library folder or file names, this is not possible when the name contains spaces.",
MessageTemplate: "library.properties name {{.}} contains spaces. Although supported, best practices is to not use spaces.",
Reference: "https://arduino.github.io/arduino-cli/latest/library-specification/#libraryproperties-file-format",
DisableModes: nil,
EnableModes: []rulemode.Type{rulemode.Default},
InfoModes: nil,
WarningModes: []rulemode.Type{rulemode.Default},
ErrorModes: []rulemode.Type{rulemode.Strict},
RuleFunction: rulefunction.LibraryPropertiesNameFieldHasSpaces,
},
{
ProjectType: projecttype.Library,
SuperprojectType: projecttype.All,
Category: "library.properties",
Subcategory: "name field",
ID: "LP016",
Brief: `name contains "library"`,
Description: "The `name` field in the library's `library.properties` metadata file contains \"library\" (case insensitive). This is implicit, only adding unnecessary length to the name.",
MessageTemplate: `Library name {{.}} contains "library". This is superfluous.`,
Reference: "https://arduino.github.io/arduino-cli/latest/library-specification/#libraryproperties-file-format",
DisableModes: nil,
EnableModes: []rulemode.Type{rulemode.Default},
InfoModes: nil,
WarningModes: []rulemode.Type{rulemode.Default},
ErrorModes: []rulemode.Type{rulemode.Strict},
RuleFunction: rulefunction.LibraryPropertiesNameFieldContainsLibrary,
},
{
ProjectType: projecttype.Library,
SuperprojectType: projecttype.Library,
Category: "library.properties",
Subcategory: "name field",
ID: "LP017",
Brief: "duplicate name",
Description: "The `name` field in the library's `library.properties` metadata file is in use by a library in the Library Manager index. A library must have a unique name value in order to be accepted into the Library Manager index.\n\nThis requirement only applies to the library.properties name value. There is no requirement to change the repository or header file names.\n\nIf your library is already in the index, use [the `--library-manager update` flag](https://arduino.github.io/arduino-lint/latest/commands/arduino-lint/#options).",
MessageTemplate: "Library name {{.}} is in use by a library in the Library Manager index. Each library must have a unique name value. If your library is already in the index, use the \"--library-manager update\" flag.",
Reference: "https://arduino.github.io/arduino-cli/latest/library-specification/#libraryproperties-file-format",
DisableModes: []rulemode.Type{rulemode.Default},
EnableModes: []rulemode.Type{rulemode.LibraryManagerSubmission},
InfoModes: nil,
WarningModes: nil,
ErrorModes: []rulemode.Type{rulemode.Default},
RuleFunction: rulefunction.LibraryPropertiesNameFieldDuplicate,
},
{
ProjectType: projecttype.Library,
SuperprojectType: projecttype.Library,
Category: "library.properties",
Subcategory: "name field",
ID: "LP018",
Brief: "not in LM index",
Description: "The library name (as defined by `name` field in [the `library.properties` metadata file](https://arduino.github.io/arduino-cli/latest/library-specification/#library-metadata)) was not found in the Library Manager index, but Arduino Lint was run in the [`--library-manager update` mode](https://arduino.github.io/arduino-lint/latest/commands/arduino-lint/#options), indicating that it was expected there.\n\nBecause the `name` value is the identifier used to install the library and define dependencies, it is not allowed to change after the library has been added to the index.",
MessageTemplate: "Library name {{.}} not found in the Library Manager index. Library names are not allowed to change after being added to the index.",
Reference: "https://github.com/arduino/library-registry/blob/main/FAQ.md#how-can-i-change-a-librarys-name",
DisableModes: []rulemode.Type{rulemode.Default},
EnableModes: []rulemode.Type{rulemode.LibraryManagerIndexed},
InfoModes: nil,
WarningModes: nil,
ErrorModes: []rulemode.Type{rulemode.Default},
RuleFunction: rulefunction.LibraryPropertiesNameFieldNotInIndex,
},
{
ProjectType: projecttype.Library,
SuperprojectType: projecttype.All,
Category: "library.properties",
Subcategory: "version field",
ID: "LP019",
Brief: "missing version field",
Description: "The `version` field is missing from the library's `library.properties` metadata file.",
MessageTemplate: "Missing version field in library.properties",
Reference: "https://arduino.github.io/arduino-cli/latest/library-specification/#libraryproperties-file-format",
DisableModes: nil,
EnableModes: []rulemode.Type{rulemode.Default},
InfoModes: nil,
WarningModes: nil,
ErrorModes: []rulemode.Type{rulemode.Default},
RuleFunction: rulefunction.LibraryPropertiesVersionFieldMissing,
},
{
ProjectType: projecttype.Library,
SuperprojectType: projecttype.All,
Category: "library.properties",
Subcategory: "version field",
ID: "LP020",
Brief: "invalid version",
Description: "The `version` field in the library's `library.properties` metadata file is invalid. It must be compliant with \"relaxed semver\".",
MessageTemplate: "library.properties version value {{.}} is invalid.",
Reference: "https://arduino.github.io/arduino-cli/latest/library-specification/#libraryproperties-file-format",
DisableModes: nil,
EnableModes: []rulemode.Type{rulemode.Default},
InfoModes: nil,
WarningModes: nil,
ErrorModes: []rulemode.Type{rulemode.Default},
RuleFunction: rulefunction.LibraryPropertiesVersionFieldNonRelaxedSemver,
},
{
ProjectType: projecttype.Library,
SuperprojectType: projecttype.All,
Category: "library.properties",
Subcategory: "version field",
ID: "LP021",
Brief: "non-semver version",
Description: "The `version` field in the library's `library.properties` metadata file is not compliant with the \"semver\" specification. Although not required, use of the standard semver version format is recommended.",
MessageTemplate: "library.properties version value {{.}} is not compliant with the semver specification.",
Reference: "https://semver.org/",
DisableModes: nil,
EnableModes: []rulemode.Type{rulemode.Default},
InfoModes: nil,
WarningModes: []rulemode.Type{rulemode.Default},
ErrorModes: []rulemode.Type{rulemode.Strict},
RuleFunction: rulefunction.LibraryPropertiesVersionFieldNonSemver,
},
{
ProjectType: projecttype.Library,
SuperprojectType: projecttype.Library,
Category: "library.properties",
Subcategory: "version field",
ID: "LP022",
Brief: "tag mismatch",
Description: "The latest [Git tag](https://git-scm.com/book/en/v2/Git-Basics-Tagging) appears to be greater than the `version` field in the library's `library.properties` metadata file. The Library Manager indexer will reject any tag that has a `library.properties` `version` value equal to a previous tag in the index.",
MessageTemplate: "The latest Git tag appears to be greater than the library.properties version value: {{.}}. You must update the version value before making the tag.",
Reference: "https://arduino.github.io/arduino-cli/latest/library-specification/#libraryproperties-file-format",
DisableModes: []rulemode.Type{rulemode.Default},
EnableModes: []rulemode.Type{rulemode.LibraryManagerIndexed},
InfoModes: nil,
WarningModes: []rulemode.Type{rulemode.Default},
ErrorModes: []rulemode.Type{rulemode.Strict},
RuleFunction: rulefunction.LibraryPropertiesVersionFieldBehindTag,
},
{
ProjectType: projecttype.Library,
SuperprojectType: projecttype.All,
Category: "library.properties",
Subcategory: "author field",
ID: "LP023",
Brief: "missing author field",
Description: "The `author` field is missing from the library's `library.properties` metadata file.",
MessageTemplate: "Missing author field in library.properties",
Reference: "https://arduino.github.io/arduino-cli/latest/library-specification/#libraryproperties-file-format",
DisableModes: nil,
EnableModes: []rulemode.Type{rulemode.Default},
InfoModes: nil,
WarningModes: nil,
ErrorModes: []rulemode.Type{rulemode.Default},
RuleFunction: rulefunction.LibraryPropertiesAuthorFieldMissing,
},
{
ProjectType: projecttype.Library,
SuperprojectType: projecttype.All,
Category: "library.properties",
Subcategory: "author field",
ID: "LP024",
Brief: "author < min length",
Description: "The `author` field in the library's `library.properties` metadata file is shorter than the minimum length.",
MessageTemplate: "library.properties author value is less than minimum length.",
Reference: "https://arduino.github.io/arduino-cli/latest/library-specification/#libraryproperties-file-format",
DisableModes: nil,
EnableModes: []rulemode.Type{rulemode.Default},
InfoModes: nil,
WarningModes: nil,
ErrorModes: []rulemode.Type{rulemode.Default},
RuleFunction: rulefunction.LibraryPropertiesAuthorFieldLTMinLength,
},
{
ProjectType: projecttype.Library,
SuperprojectType: projecttype.All,
Category: "library.properties",
Subcategory: "maintainer field",
ID: "LP025",
Brief: "missing maintainer field",
Description: "The `maintainer` field is missing from the library's `library.properties` metadata file.",
MessageTemplate: "Missing maintainer field in library.properties",
Reference: "https://arduino.github.io/arduino-cli/latest/library-specification/#libraryproperties-file-format",
DisableModes: nil,
EnableModes: []rulemode.Type{rulemode.Default},
InfoModes: nil,
WarningModes: nil,
ErrorModes: []rulemode.Type{rulemode.Default},
RuleFunction: rulefunction.LibraryPropertiesMaintainerFieldMissing,
},
{
ProjectType: projecttype.Library,
SuperprojectType: projecttype.All,
Category: "library.properties",
Subcategory: "maintainer field",
ID: "LP026",
Brief: "maintainer < min length",
Description: "The `maintainer` field in the library's `library.properties` metadata file is shorter than the minimum length.",
MessageTemplate: "library.properties maintainer value is less than minimum length.",
Reference: "https://arduino.github.io/arduino-cli/latest/library-specification/#libraryproperties-file-format",
DisableModes: nil,
EnableModes: []rulemode.Type{rulemode.Default},
InfoModes: nil,
WarningModes: nil,
ErrorModes: []rulemode.Type{rulemode.Default},
RuleFunction: rulefunction.LibraryPropertiesMaintainerFieldLTMinLength,
},
{
ProjectType: projecttype.Library,
SuperprojectType: projecttype.All,
Category: "library.properties",
Subcategory: "maintainer field",
ID: "LP027",
Brief: `maintainer starts with "Arduino"`,
Description: "The `maintainer` field in the library's `library.properties` metadata file starts with \"Arduino\" (case insensitive). 3rd party libraries are not maintained by Arduino.\n\nIf the library is maintained by Arduino, configure Arduino Lint in [\"official\" mode](https://arduino.github.io/arduino-lint/latest/#environment-variables).",
MessageTemplate: `library.properties maintainer value {{.}} starts with "Arduino". 3rd party libraries are not maintained by Arduino.`,
Reference: "https://arduino.github.io/arduino-cli/latest/library-specification/#libraryproperties-file-format",
DisableModes: []rulemode.Type{rulemode.Official},
EnableModes: []rulemode.Type{rulemode.Default},
InfoModes: nil,
WarningModes: []rulemode.Type{rulemode.Default},
ErrorModes: []rulemode.Type{rulemode.Strict},
RuleFunction: rulefunction.LibraryPropertiesMaintainerFieldStartsWithArduino,
},
{
ProjectType: projecttype.Library,
SuperprojectType: projecttype.All,
Category: "library.properties",
Subcategory: "maintainer field",
ID: "LP057",
Brief: `maintainer contains "Arduino"`,
Description: "The `maintainer` field in the library's `library.properties` metadata file contains \"Arduino\" (case insensitive). 3rd party libraries are not maintained by Arduino.\n\nIf the library is maintained by Arduino, configure Arduino Lint in [\"official\" mode](https://arduino.github.io/arduino-lint/latest/#environment-variables).",
MessageTemplate: `library.properties maintainer value {{.}} contains "Arduino". 3rd party libraries are not maintained by Arduino.`,
Reference: "https://arduino.github.io/arduino-cli/latest/library-specification/#libraryproperties-file-format",
DisableModes: []rulemode.Type{rulemode.Official},
EnableModes: []rulemode.Type{rulemode.Default},
InfoModes: nil,
WarningModes: []rulemode.Type{rulemode.Default},
ErrorModes: []rulemode.Type{rulemode.Strict},
RuleFunction: rulefunction.LibraryPropertiesMaintainerFieldContainsArduino,
},
{
ProjectType: projecttype.Library,
SuperprojectType: projecttype.All,
Category: "library.properties",
Subcategory: "email field",
ID: "LP028",
Brief: `"email" used as alias for "maintainer"`,
Description: "The library's `library.properties` metadata file uses the deprecated `email` field instead of the standard `maintainer`.",
MessageTemplate: `library.properties "email" field used as alias for "maintainer". This is deprecated.`,
Reference: "https://arduino.github.io/arduino-cli/latest/library-specification/#libraryproperties-file-format",
DisableModes: nil,
EnableModes: []rulemode.Type{rulemode.Default},
InfoModes: nil,
WarningModes: []rulemode.Type{rulemode.Permissive},
ErrorModes: []rulemode.Type{rulemode.Default},
RuleFunction: rulefunction.LibraryPropertiesEmailFieldAsMaintainerAlias,
},
{
ProjectType: projecttype.Library,
SuperprojectType: projecttype.All,
Category: "library.properties",
Subcategory: "email field",
ID: "LP029",
Brief: "email < min length",
Description: "The `email` field in the library's `library.properties` metadata file is shorter than the minimum length.",
MessageTemplate: "library.properties email value is less than minimum length.",
Reference: "",
DisableModes: nil,
EnableModes: []rulemode.Type{rulemode.Default},
InfoModes: nil,
WarningModes: nil,
ErrorModes: []rulemode.Type{rulemode.Default},
RuleFunction: rulefunction.LibraryPropertiesEmailFieldLTMinLength,
},
{
ProjectType: projecttype.Library,
SuperprojectType: projecttype.All,
Category: "library.properties",
Subcategory: "email field",
ID: "LP030",
Brief: `email starts with "Arduino"`,
Description: "The `maintainer` field in the library's `library.properties` metadata file starts with \"Arduino\" (case insensitive). 3rd party libraries are not maintained by Arduino.",
MessageTemplate: `library.properties email value {{.}} starts with "Arduino". 3rd party libraries are not maintained by Arduino.`,
Reference: "",
DisableModes: []rulemode.Type{rulemode.Official},
EnableModes: []rulemode.Type{rulemode.Default},
InfoModes: nil,
WarningModes: []rulemode.Type{rulemode.Default},
ErrorModes: []rulemode.Type{rulemode.Strict},
RuleFunction: rulefunction.LibraryPropertiesEmailFieldStartsWithArduino,
},
{
ProjectType: projecttype.Library,
SuperprojectType: projecttype.All,
Category: "library.properties",
Subcategory: "sentence field",
ID: "LP031",
Brief: "missing sentence field",
Description: "The `sentence` field is missing from the library's `library.properties` metadata file.",
MessageTemplate: "Missing sentence field in library.properties",
Reference: "https://arduino.github.io/arduino-cli/latest/library-specification/#libraryproperties-file-format",
DisableModes: nil,
EnableModes: []rulemode.Type{rulemode.Default},
InfoModes: nil,
WarningModes: nil,
ErrorModes: []rulemode.Type{rulemode.Default},
RuleFunction: rulefunction.LibraryPropertiesSentenceFieldMissing,
},
{
ProjectType: projecttype.Library,
SuperprojectType: projecttype.All,
Category: "library.properties",
Subcategory: "sentence field",
ID: "LP032",
Brief: "sentence < min length",
Description: "The `sentence` field in the library's `library.properties` metadata file is shorter than the minimum length.",
MessageTemplate: "library.properties sentence value is less than minimum length.",
Reference: "https://arduino.github.io/arduino-cli/latest/library-specification/#libraryproperties-file-format",
DisableModes: nil,
EnableModes: []rulemode.Type{rulemode.Default},
InfoModes: nil,
WarningModes: nil,
ErrorModes: []rulemode.Type{rulemode.Default},
RuleFunction: rulefunction.LibraryPropertiesSentenceFieldLTMinLength,
},
{
ProjectType: projecttype.Library,
SuperprojectType: projecttype.All,
Category: "library.properties",
Subcategory: "sentence field",
ID: "LP033",
Brief: "sentence spell check",
Description: "The `sentence` field in the library's `library.properties` metadata file contains a commonly misspelled word.",
MessageTemplate: "A commonly misspelled word was found in the library.properties sentence field. Suggested correction: {{.}}",
Reference: "https://arduino.github.io/arduino-cli/latest/library-specification/#libraryproperties-file-format",
DisableModes: nil,
EnableModes: []rulemode.Type{rulemode.Default},
InfoModes: nil,
WarningModes: []rulemode.Type{rulemode.Default},
ErrorModes: nil,
RuleFunction: rulefunction.LibraryPropertiesSentenceFieldSpellCheck,
},
{
ProjectType: projecttype.Library,
SuperprojectType: projecttype.All,
Category: "library.properties",
Subcategory: "paragraph field",
ID: "LP034",
Brief: "missing paragraph field",
Description: "The `paragraph` field is missing from the library's `library.properties` metadata file.",
MessageTemplate: "Missing paragraph field in library.properties",
Reference: "https://arduino.github.io/arduino-cli/latest/library-specification/#libraryproperties-file-format",
DisableModes: nil,
EnableModes: []rulemode.Type{rulemode.Default},
InfoModes: nil,
WarningModes: nil,
ErrorModes: []rulemode.Type{rulemode.Default},
RuleFunction: rulefunction.LibraryPropertiesParagraphFieldMissing,
},
{
ProjectType: projecttype.Library,
SuperprojectType: projecttype.All,
Category: "library.properties",
Subcategory: "paragraph field",
ID: "LP035",
Brief: "paragraph spell check",
Description: "The `paragraph` field in the library's `library.properties` metadata file contains a commonly misspelled word.",
MessageTemplate: "A commonly misspelled word was found in the library.properties paragraph field. Suggested correction: {{.}}",
Reference: "https://arduino.github.io/arduino-cli/latest/library-specification/#libraryproperties-file-format",
DisableModes: nil,
EnableModes: []rulemode.Type{rulemode.Default},
InfoModes: nil,
WarningModes: []rulemode.Type{rulemode.Default},
ErrorModes: nil,
RuleFunction: rulefunction.LibraryPropertiesParagraphFieldSpellCheck,
},
{
ProjectType: projecttype.Library,
SuperprojectType: projecttype.All,
Category: "library.properties",
Subcategory: "paragraph field",
ID: "LP036",
Brief: "paragraph repeats sentence",
Description: "The `paragraph` field in the library's `library.properties` metadata file repeats the `sentence` field. These are displayed together so redundancy is not needed.",
MessageTemplate: "The library.properties paragraph field repeats the sentence field. These are displayed together so redundancy is not needed.",
Reference: "https://arduino.github.io/arduino-cli/latest/library-specification/#libraryproperties-file-format",
DisableModes: nil,
EnableModes: []rulemode.Type{rulemode.Default},
InfoModes: nil,
WarningModes: []rulemode.Type{rulemode.Default},
ErrorModes: []rulemode.Type{rulemode.Strict},
RuleFunction: rulefunction.LibraryPropertiesParagraphFieldRepeatsSentence,
},
{
ProjectType: projecttype.Library,
SuperprojectType: projecttype.All,
Category: "library.properties",
Subcategory: "category field",
ID: "LP037",
Brief: "missing category field",
Description: "The `category` field is missing from the library's `library.properties` metadata file.This can cause a warning and results in the default \"Uncategorized\" category being used.",
MessageTemplate: "Missing category field in library.properties",
Reference: "https://arduino.github.io/arduino-cli/latest/library-specification/#libraryproperties-file-format",
DisableModes: nil,
EnableModes: []rulemode.Type{rulemode.Default},
InfoModes: nil,
WarningModes: []rulemode.Type{rulemode.Default},
ErrorModes: []rulemode.Type{rulemode.Strict},
RuleFunction: rulefunction.LibraryPropertiesCategoryFieldMissing,
},
{
ProjectType: projecttype.Library,
SuperprojectType: projecttype.All,
Category: "library.properties",
Subcategory: "category field",
ID: "LP038",
Brief: "invalid category value",
Description: "The `category` field in the library's `library.properties` metadata file has an invalid value. This can cause a warning and results in the default \"Uncategorized\" category being used.",
MessageTemplate: "Invalid category field value {{.}} in library.properties",
Reference: "https://arduino.github.io/arduino-cli/latest/library-specification/#libraryproperties-file-format",
DisableModes: nil,
EnableModes: []rulemode.Type{rulemode.Default},
InfoModes: nil,
WarningModes: []rulemode.Type{rulemode.Permissive},
ErrorModes: []rulemode.Type{rulemode.Default},
RuleFunction: rulefunction.LibraryPropertiesCategoryFieldInvalid,
},
{
ProjectType: projecttype.Library,
SuperprojectType: projecttype.All,
Category: "library.properties",
Subcategory: "category field",
ID: "LP039",
Brief: `"Uncategorized" category value`,
Description: "The `category` field in the library's `library.properties` metadata file is set to \"Uncategorized\". There is no good reason for using this non-specification compliant category value.",
MessageTemplate: `Use of "Uncategorized" category value in library.properties. Please use one of the allowed categories.`,
Reference: "https://arduino.github.io/arduino-cli/latest/library-specification/#libraryproperties-file-format",
DisableModes: nil,
EnableModes: []rulemode.Type{rulemode.Default},
InfoModes: nil,
WarningModes: []rulemode.Type{rulemode.Default},
ErrorModes: []rulemode.Type{rulemode.Strict},
RuleFunction: rulefunction.LibraryPropertiesCategoryFieldUncategorized,
},
{
ProjectType: projecttype.Library,
SuperprojectType: projecttype.All,
Category: "library.properties",
Subcategory: "url field",
ID: "LP040",
Brief: "missing url field",
Description: "The `url` field is missing from the library's `library.properties` metadata file.",
MessageTemplate: "Missing url field in library.properties",
Reference: "https://arduino.github.io/arduino-cli/latest/library-specification/#libraryproperties-file-format",
DisableModes: nil,
EnableModes: []rulemode.Type{rulemode.Default},
InfoModes: nil,
WarningModes: nil,
ErrorModes: []rulemode.Type{rulemode.Default},
RuleFunction: rulefunction.LibraryPropertiesURLFieldMissing,
},
{
ProjectType: projecttype.Library,
SuperprojectType: projecttype.All,
Category: "library.properties",
Subcategory: "url field",
ID: "LP056",
Brief: "url < min length",
Description: "The `url` field in the library's `library.properties` metadata file is shorter than the minimum length.",
MessageTemplate: "library.properties url value is less than minimum length.",
Reference: "https://arduino.github.io/arduino-cli/latest/library-specification/#libraryproperties-file-format",
DisableModes: nil,
EnableModes: []rulemode.Type{rulemode.Default},
InfoModes: nil,
WarningModes: nil,
ErrorModes: []rulemode.Type{rulemode.Default},
RuleFunction: rulefunction.LibraryPropertiesURLFieldLTMinLength,
},
{
ProjectType: projecttype.Library,
SuperprojectType: projecttype.All,
Category: "library.properties",
Subcategory: "url field",
ID: "LP041",
Brief: "invalid url format",
Description: "The `url` field in the library's `library.properties` metadata file has an invalid URL format.",
MessageTemplate: "library.properties url field value {{.}} does not have a valid URL format.",
Reference: "https://arduino.github.io/arduino-cli/latest/library-specification/#libraryproperties-file-format",
DisableModes: nil,
EnableModes: []rulemode.Type{rulemode.Default},
InfoModes: nil,
WarningModes: []rulemode.Type{rulemode.Permissive},
ErrorModes: []rulemode.Type{rulemode.Default},
RuleFunction: rulefunction.LibraryPropertiesURLFieldInvalid,
},
{
ProjectType: projecttype.Library,
SuperprojectType: projecttype.All,
Category: "library.properties",