mirror of
https://github.com/konpa/devicon.git
synced 2025-08-12 09:34:36 +02:00
Feature/sort devicon json and add sort check (#1405)
* indent and sort devicon.json
* add check to see if devicon.json is sorted
* Update devicon.json
Sort `devicon.json` of commit `77ff589df1fcffde36d9f3239d658046663d5588` from `develop` branch.
* Apply suggestions from code review
* Apply suggestions from code review
Co-authored-by: Josélio Júnior <76992016+lunatic-fox@users.noreply.github.com>
* Update `devicon.json` with eb35d73a01
Co-authored-by: unknown <joseliojrx25@gmail.com>
Co-authored-by: Josélio Júnior <76992016+lunatic-fox@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
300685abbf
commit
3d20d58cd3
11
.github/scripts/check_icon_pr.py
vendored
11
.github/scripts/check_icon_pr.py
vendored
@@ -18,10 +18,15 @@ def main():
|
||||
try:
|
||||
all_icons = filehandler.get_json_file_content(args.devicon_json_path)
|
||||
|
||||
devicon_err_msg = []
|
||||
#First check if devicon.json is sorted
|
||||
if sorted(all_icons, key=lambda d: d['name']) != all_icons:
|
||||
devicon_err_msg.append(f"devicon.json is not sorted correctly.\nPlease make sure that your icon is added in the `devicon.json` file at the correct alphabetic position\nas seen here: https://github.com/devicons/devicon/wiki/Updating-%60devicon.json%60")
|
||||
|
||||
# get only the icon object that has the name matching the pr title
|
||||
filtered_icon = util.find_object_added_in_pr(all_icons, args.pr_title)
|
||||
print("Checking devicon.json object: " + str(filtered_icon))
|
||||
devicon_err_msg = check_devicon_object(filtered_icon)
|
||||
devicon_err_msg.append(check_devicon_object(filtered_icon))
|
||||
|
||||
# check the file names
|
||||
filename_err_msg = ""
|
||||
@@ -40,8 +45,8 @@ def main():
|
||||
svg_err_msg = check_svgs(svgs)
|
||||
|
||||
err_msg = []
|
||||
if devicon_err_msg != "":
|
||||
err_msg.append(devicon_err_msg)
|
||||
if devicon_err_msg != []:
|
||||
err_msg.extend(devicon_err_msg)
|
||||
|
||||
if filename_err_msg != "":
|
||||
err_msg.append(filename_err_msg)
|
||||
|
1243
devicon.json
1243
devicon.json
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user