49
49
ERRRO_UNABLE_PULL_REPO_EXAMPLES = "Unable to retrieve examples folder contents"
50
50
ERROR_WIKI_DISABLED = "Wiki should be disabled"
51
51
52
+ # Constant for bundle repo name.
53
+ BUNDLE_REPO_NAME = "Adafruit_CircuitPython_Bundle"
54
+
55
+ # Repos to ignore for validation they exist in the bundle. Add repos by their
56
+ # full name on Github (like Adafruit_CircuitPython_Bundle).
57
+ BUNDLE_IGNORE_LIST = [BUNDLE_REPO_NAME ]
58
+
52
59
53
60
def parse_gitmodules (input_text ):
54
61
"""Parse a .gitmodules file and return a list of all the git submodules
@@ -209,8 +216,9 @@ def validate_repo_state(repo):
209
216
if not repo ["permissions" ]["push" ]:
210
217
errors .append (ERROR_MISSING_LIBRARIANS )
211
218
if not is_repo_in_bundle (full_repo ["clone_url" ], bundle_submodules ) and \
212
- not repo ["name" ] == "Adafruit_CircuitPython_Bundle" : # Bundle doesn't
213
- # bundle itself.
219
+ not repo ["name" ] in BUNDLE_IGNORE_LIST : # Don't assume the bundle will
220
+ # bundle itself and possibly
221
+ # other repos.
214
222
errors .append (ERROR_NOT_IN_BUNDLE )
215
223
return errors
216
224
@@ -223,7 +231,7 @@ def validate_contents(repo):
223
231
if not (repo ["owner" ]["login" ] == "adafruit" and
224
232
repo ["name" ].startswith ("Adafruit_CircuitPython" )):
225
233
return []
226
- if repo ["name" ] == "Adafruit_CircuitPython_Bundle" :
234
+ if repo ["name" ] == BUNDLE_REPO_NAME :
227
235
return []
228
236
229
237
content_list = github .get ("/repos/" + repo ["full_name" ] + "/contents/" )
0 commit comments