Skip to content

Commit 12170ff

Browse files
committed
Don't run the readme check for subprojects
The superproject should have a readme, but it's not necessarily essential for the subproject to have one as well.
1 parent 1e6f988 commit 12170ff

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

Diff for: check/checkfunctions/checkfunctions.go

+4
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ func containsIncorrectPathBaseCase(pathList paths.PathList, correctBaseName stri
6969

7070
// MissingReadme checks if the project has a readme that will be recognized by GitHub.
7171
func MissingReadme() (result checkresult.Type, output string) {
72+
if checkdata.ProjectType() != checkdata.SuperProjectType() {
73+
return checkresult.NotRun, "Readme not required for subprojects"
74+
}
75+
7276
// https://github.com/github/markup/blob/master/README.md
7377
readmeRegexp := regexp.MustCompile(`(?i)^readme\.(markdown)|(mdown)|(mkdn)|(md)|(textile)|(rdoc)|(org)|(creole)|(mediawiki)|(wiki)|(rst)|(asciidoc)|(adoc)|(asc)|(pod)|(txt)$`)
7478

Diff for: check/checkfunctions/checkfunctions_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ func checkCheckFunction(checkFunction Type, testTables []checkFunctionTestTable,
6464

6565
func TestMissingReadme(t *testing.T) {
6666
testTables := []checkFunctionTestTable{
67+
{"Subproject", "readme", projecttype.Sketch, projecttype.Library, checkresult.NotRun, ""},
6768
{"Readme", "readme", projecttype.Sketch, projecttype.Sketch, checkresult.Pass, ""},
6869
{"No readme", "no-readme", projecttype.Sketch, projecttype.Sketch, checkresult.Fail, ""},
6970
}

0 commit comments

Comments
 (0)