@@ -23,7 +23,7 @@ import (
23
23
"strings"
24
24
25
25
"github.com/arduino/arduino-lint/internal/check/checkresult"
26
- "github.com/arduino/arduino-lint/internal/project/checkdata "
26
+ "github.com/arduino/arduino-lint/internal/project/projectdata "
27
27
"github.com/arduino/arduino-lint/internal/project/sketch"
28
28
"github.com/arduino/go-paths-helper"
29
29
)
@@ -34,17 +34,17 @@ type Type func() (result checkresult.Type, output string)
34
34
35
35
// MissingReadme checks if the project has a readme that will be recognized by GitHub.
36
36
func MissingReadme () (result checkresult.Type , output string ) {
37
- if checkdata .ProjectType () != checkdata .SuperProjectType () {
37
+ if projectdata .ProjectType () != projectdata .SuperProjectType () {
38
38
return checkresult .Skip , "Readme not required for subprojects"
39
39
}
40
40
41
41
// https://github.com/github/markup/blob/master/README.md
42
42
readmeRegexp := regexp .MustCompile (`(?i)^readme\.(markdown)|(mdown)|(mkdn)|(md)|(textile)|(rdoc)|(org)|(creole)|(mediawiki)|(wiki)|(rst)|(asciidoc)|(adoc)|(asc)|(pod)|(txt)$` )
43
43
44
44
// https://docs.github.com/en/free-pro-team@latest/github/creating-cloning-and-archiving-repositories/about-readmes#about-readmes
45
- if pathContainsRegexpMatch (checkdata .ProjectPath (), readmeRegexp ) ||
46
- (checkdata .ProjectPath ().Join ("docs" ).Exist () && pathContainsRegexpMatch (checkdata .ProjectPath ().Join ("docs" ), readmeRegexp )) ||
47
- (checkdata .ProjectPath ().Join (".github" ).Exist () && pathContainsRegexpMatch (checkdata .ProjectPath ().Join (".github" ), readmeRegexp )) {
45
+ if pathContainsRegexpMatch (projectdata .ProjectPath (), readmeRegexp ) ||
46
+ (projectdata .ProjectPath ().Join ("docs" ).Exist () && pathContainsRegexpMatch (projectdata .ProjectPath ().Join ("docs" ), readmeRegexp )) ||
47
+ (projectdata .ProjectPath ().Join (".github" ).Exist () && pathContainsRegexpMatch (projectdata .ProjectPath ().Join (".github" ), readmeRegexp )) {
48
48
return checkresult .Pass , ""
49
49
}
50
50
@@ -53,7 +53,7 @@ func MissingReadme() (result checkresult.Type, output string) {
53
53
54
54
// MissingLicenseFile checks if the project has a license file that will be recognized by GitHub.
55
55
func MissingLicenseFile () (result checkresult.Type , output string ) {
56
- if checkdata .ProjectType () != checkdata .SuperProjectType () {
56
+ if projectdata .ProjectType () != projectdata .SuperProjectType () {
57
57
return checkresult .Skip , "License file not required for subprojects"
58
58
}
59
59
@@ -64,7 +64,7 @@ func MissingLicenseFile() (result checkresult.Type, output string) {
64
64
licenseRegexp := regexp .MustCompile (`(?i)^(((un)?licen[sc]e)|(copy(ing|right))|(ofl)|(patents))(\.((md)|(markdown)|(txt)|(html)))?$` )
65
65
66
66
// License file must be in root of repo
67
- if pathContainsRegexpMatch (checkdata .ProjectPath (), licenseRegexp ) {
67
+ if pathContainsRegexpMatch (projectdata .ProjectPath (), licenseRegexp ) {
68
68
return checkresult .Pass , ""
69
69
}
70
70
@@ -75,7 +75,7 @@ func MissingLicenseFile() (result checkresult.Type, output string) {
75
75
func IncorrectArduinoDotHFileNameCase () (result checkresult.Type , output string ) {
76
76
incorrectCaseRegexp := regexp .MustCompile (`^\s*#\s*include\s*["<](a((?i)rduino)|(ARDUINO))\.[hH][">]` )
77
77
78
- directoryListing , err := checkdata .ProjectPath ().ReadDirRecursive ()
78
+ directoryListing , err := projectdata .ProjectPath ().ReadDirRecursive ()
79
79
if err != nil {
80
80
panic (err )
81
81
}
0 commit comments