@@ -43,6 +43,22 @@ func LibraryPropertiesFormat() (result checkresult.Type, output string) {
43
43
return checkresult .Pass , ""
44
44
}
45
45
46
+ // MisspelledLibraryPropertiesFileName checks for incorrectly spelled library.properties file name.
47
+ func MisspelledLibraryPropertiesFileName () (result checkresult.Type , output string ) {
48
+ directoryListing , err := checkdata .ProjectPath ().ReadDir ()
49
+ if err != nil {
50
+ panic (err )
51
+ }
52
+ directoryListing .FilterOutDirs ()
53
+
54
+ path , found := containsMisspelledPathBaseName (directoryListing , "library.properties" , "(?i)^librar(y)|(ie)s?[.-_]?propert(y)|(ie)s?$" )
55
+ if found {
56
+ return checkresult .Fail , path .String ()
57
+ }
58
+
59
+ return checkresult .Pass , ""
60
+ }
61
+
46
62
// LibraryPropertiesNameFieldMissing checks for missing library.properties "name" field.
47
63
func LibraryPropertiesNameFieldMissing () (result checkresult.Type , output string ) {
48
64
if checkdata .LibraryPropertiesLoadError () != nil {
@@ -965,6 +981,38 @@ func LibraryFolderNameGTMaxLength() (result checkresult.Type, output string) {
965
981
return checkresult .Pass , ""
966
982
}
967
983
984
+ // MisspelledExamplesFolderName checks for incorrectly spelled `examples` folder name.
985
+ func MisspelledExamplesFolderName () (result checkresult.Type , output string ) {
986
+ directoryListing , err := checkdata .ProjectPath ().ReadDir ()
987
+ if err != nil {
988
+ panic (err )
989
+ }
990
+ directoryListing .FilterDirs ()
991
+
992
+ path , found := containsMisspelledPathBaseName (directoryListing , "examples" , "(?i)^e((x)|(xs)|(s))((am)|(ma))p((le)|(el))s?$" )
993
+ if found {
994
+ return checkresult .Fail , path .String ()
995
+ }
996
+
997
+ return checkresult .Pass , ""
998
+ }
999
+
1000
+ // MisspelledExtrasFolderName checks for incorrectly spelled `extras` folder name.
1001
+ func MisspelledExtrasFolderName () (result checkresult.Type , output string ) {
1002
+ directoryListing , err := checkdata .ProjectPath ().ReadDir ()
1003
+ if err != nil {
1004
+ panic (err )
1005
+ }
1006
+ directoryListing .FilterDirs ()
1007
+
1008
+ path , found := containsMisspelledPathBaseName (directoryListing , "extras" , "(?i)^extra$" )
1009
+ if found {
1010
+ return checkresult .Fail , path .String ()
1011
+ }
1012
+
1013
+ return checkresult .Pass , ""
1014
+ }
1015
+
968
1016
// spellCheckLibraryPropertiesFieldValue returns the value of the provided library.properties field with commonly misspelled words corrected.
969
1017
func spellCheckLibraryPropertiesFieldValue (fieldName string ) (result checkresult.Type , output string ) {
970
1018
if checkdata .LibraryPropertiesLoadError () != nil {
0 commit comments