Skip to content

Commit

Permalink
PR remarks
Browse files Browse the repository at this point in the history
  • Loading branch information
tdejoigny-ledger committed Sep 27, 2023
1 parent d23d70f commit cc4df48
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions scripts/app_load_params_lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,16 @@ def check_database_appnames(database_path: Path):
database_str = f.read()
database = json.loads(database_str)

db_rev = {v["appName"]: k for k, v in database.items()}
db_rev = {v["appName"].lower().replace(" ","").replace("_", "").replace("-", ""): k for k,
v in database.items()}

for variant, params in database.items():
app_name = params["appName"]
db_rev_variant = db_rev[app_name]
db_rev_variant = db_rev[app_name.lower().replace(" ","").replace("_", "").replace("-", "")]
if db_rev_variant != variant:
print(f"[ERROR] Conflict on appName between '{db_rev_variant}' and '{variant}'")
ret = -1

app_names_list =[v["appName"].lower().replace(" ","").replace("_", "") for v in
database.values()]
if len(app_names_list) != len(set(app_names_list)):
print("[ERROR] Duplicate on appName - Application name shall be unique.")
ret = -1

if ret != 0:
exit(ret)

Expand Down

0 comments on commit cc4df48

Please sign in to comment.