Skip to content

Commit 8539627

Browse files
authored
Merge pull request #224 from adafruit/branch-check
Added check to ensure that all libraries use main as their default branch
2 parents 8da89ce + 6144507 commit 8539627

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

adabot/lib/circuitpython_library_validators.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ def get_result(self):
9292
ERROR_MISSING_REQUIREMENTS_TXT = "For pypi compatibility, missing requirements.txt"
9393
ERROR_MISSING_BLINKA = "For pypi compatibility, missing Adafruit-Blinka in requirements.txt"
9494
ERROR_NOT_IN_BUNDLE = "Not in bundle."
95+
ERROR_INCORRECT_DEFAULT_BRANCH = "Default branch is not main"
9596
ERROR_UNABLE_PULL_REPO_CONTENTS = "Unable to pull repo contents"
9697
ERROR_UNABLE_PULL_REPO_DETAILS = "Unable to pull repo details"
9798
ERRRO_UNABLE_PULL_REPO_EXAMPLES = "Unable to retrieve examples folder contents"
@@ -1210,3 +1211,13 @@ def validate_passes_linting(self, repo):
12101211
f.write(''.join(pylint_result))
12111212

12121213
return []
1214+
1215+
def validate_default_branch(self, repo):
1216+
""" Makes sure that the default branch is main """
1217+
if not repo["name"].startswith("Adafruit_CircuitPython"):
1218+
return []
1219+
1220+
if repo["default_branch"] != "main":
1221+
return [ERROR_INCORRECT_DEFAULT_BRANCH]
1222+
1223+
return []

0 commit comments

Comments
 (0)