Skip to content

Commit e1fae5d

Browse files
authored
Merge pull request #261 from adafruit/examples-dir-change
Changed examples dir check to be satisfied if repo name is at beginning of file or subdir containing file
2 parents df690de + ad023d4 commit e1fae5d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

adabot/lib/circuitpython_library_validators.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -780,16 +780,17 @@ def validate_contents(self, repo):
780780
else:
781781

782782
def __check_lib_name(
783-
repo_name, file_name
783+
repo_name,
784+
file_name,
784785
): # pylint: disable=unused-private-member
785786
"""Nested function to test example file names.
786787
Allows examples to either match the repo name,
787788
or have additional underscores separating the repo name.
788789
"""
789790
file_names = set()
790-
file_names.add(file_name)
791+
file_names.add(file_name[9:])
791792

792-
name_split = file_name.split("_")
793+
name_split = file_name[9:].split("_")
793794
name_rebuilt = "".join(
794795
(part for part in name_split if ".py" not in part)
795796
)
@@ -807,7 +808,7 @@ def __check_lib_name(
807808
for example in examples_list:
808809
if example["name"].endswith(".py"):
809810
check_lib_name = __check_lib_name(
810-
lib_name, example["name"].lower()
811+
lib_name, example["path"].lower()
811812
)
812813
if not check_lib_name:
813814
all_have_name = False

0 commit comments

Comments
 (0)