Error on duplicated crates (#3082)

#2970 accidentally added a crate twice to the workspace. Now extending
the workspace check to explicitly error then.

I think the check should also be required now.

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
This commit is contained in:
Oliver Tale-Yazdi
2024-01-29 15:10:57 +01:00
committed by GitHub
parent 6a168ad57a
commit 0291658eb7
2 changed files with 11 additions and 1 deletions
+11
View File
@@ -27,6 +27,7 @@ def main(root, exclude):
all_crates = get_crates(root, exclude)
print(f'📦 Found {len(all_crates)} crates in total')
check_duplicates(workspace_crates)
check_missing(workspace_crates, all_crates)
check_links(all_crates)
@@ -89,6 +90,16 @@ def get_crates(workspace_dir, exclude_crates) -> dict:
return crates
# Check that there are no duplicate entries in the workspace.
def check_duplicates(workspace_crates):
print(f'🔎 Checking for duplicate crates')
found = {}
for path in workspace_crates:
if path in found:
print(f'❌ crate is listed twice in the workspace {path}')
sys.exit(1)
found[path] = True
# Check that all crates are in the workspace.
def check_missing(workspace_crates, all_crates):
print(f'🔎 Checking for missing crates')