@@ -23,7 +23,7 @@ import (
2323 "strings"
2424
2525 "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 "
2727 "github.com/arduino/arduino-lint/internal/project/sketch"
2828 "github.com/arduino/go-paths-helper"
2929)
@@ -34,17 +34,17 @@ type Type func() (result checkresult.Type, output string)
3434
3535// MissingReadme checks if the project has a readme that will be recognized by GitHub.
3636func MissingReadme () (result checkresult.Type , output string ) {
37- if checkdata .ProjectType () != checkdata .SuperProjectType () {
37+ if projectdata .ProjectType () != projectdata .SuperProjectType () {
3838 return checkresult .Skip , "Readme not required for subprojects"
3939 }
4040
4141 // https://github.com/github/markup/blob/master/README.md
4242 readmeRegexp := regexp .MustCompile (`(?i)^readme\.(markdown)|(mdown)|(mkdn)|(md)|(textile)|(rdoc)|(org)|(creole)|(mediawiki)|(wiki)|(rst)|(asciidoc)|(adoc)|(asc)|(pod)|(txt)$` )
4343
4444 // 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 )) {
4848 return checkresult .Pass , ""
4949 }
5050
@@ -53,7 +53,7 @@ func MissingReadme() (result checkresult.Type, output string) {
5353
5454// MissingLicenseFile checks if the project has a license file that will be recognized by GitHub.
5555func MissingLicenseFile () (result checkresult.Type , output string ) {
56- if checkdata .ProjectType () != checkdata .SuperProjectType () {
56+ if projectdata .ProjectType () != projectdata .SuperProjectType () {
5757 return checkresult .Skip , "License file not required for subprojects"
5858 }
5959
@@ -64,7 +64,7 @@ func MissingLicenseFile() (result checkresult.Type, output string) {
6464 licenseRegexp := regexp .MustCompile (`(?i)^(((un)?licen[sc]e)|(copy(ing|right))|(ofl)|(patents))(\.((md)|(markdown)|(txt)|(html)))?$` )
6565
6666 // License file must be in root of repo
67- if pathContainsRegexpMatch (checkdata .ProjectPath (), licenseRegexp ) {
67+ if pathContainsRegexpMatch (projectdata .ProjectPath (), licenseRegexp ) {
6868 return checkresult .Pass , ""
6969 }
7070
@@ -75,7 +75,7 @@ func MissingLicenseFile() (result checkresult.Type, output string) {
7575func IncorrectArduinoDotHFileNameCase () (result checkresult.Type , output string ) {
7676 incorrectCaseRegexp := regexp .MustCompile (`^\s*#\s*include\s*["<](a((?i)rduino)|(ARDUINO))\.[hH][">]` )
7777
78- directoryListing , err := checkdata .ProjectPath ().ReadDirRecursive ()
78+ directoryListing , err := projectdata .ProjectPath ().ReadDirRecursive ()
7979 if err != nil {
8080 panic (err )
8181 }
0 commit comments