1
0
mirror of https://github.com/konpa/devicon.git synced 2025-08-23 14:43:56 +02:00

Update the check-bot (#970)

* Add check for strokes in check-bot

* Add check for svg file name

* Update gulpfile to remove x and y of svg elem

* Revert name changes to err file

* check-bot now check devicon object as well

* Fixed minor bugs

* Improve logging in check_icon

Co-authored-by: David Leal <halfpacho@gmail.com>
This commit is contained in:
Thomas Bui
2022-03-13 15:02:41 -07:00
committed by GitHub
parent 5153e0f0da
commit bb589370da
9 changed files with 221 additions and 194 deletions

View File

@@ -68,7 +68,7 @@ def get_svgs_paths(new_icons: List[dict], icons_folder_path: str,
folder_path = Path(icons_folder_path, icon_info['name'])
if not folder_path.is_dir():
raise ValueError(f"Invalid path. This is not a directory: {folder_path}.")
raise ValueError(f"Invalid path. This is not a directory: '{folder_path}'.")
if icon_versions_only:
get_icon_svgs_paths(folder_path, icon_info, file_paths, as_str)
@@ -100,7 +100,7 @@ def get_icon_svgs_paths(folder_path: Path, icon_info: dict,
if path.exists():
file_paths.append(str(path) if as_str else path)
else:
raise ValueError(f"This path doesn't exist: {path}")
raise ValueError(f"This path doesn't exist: '{path}'")
def get_all_svgs_paths(folder_path: Path, icon_info: dict,
@@ -119,7 +119,7 @@ def get_all_svgs_paths(folder_path: Path, icon_info: dict,
if path.exists():
file_paths.append(str(path) if as_str else path)
else:
raise ValueError(f"This path doesn't exist: {path}")
raise ValueError(f"This path doesn't exist: '{path}'")
def is_alias(font_version: str, aliases: List[dict]):
@@ -207,6 +207,14 @@ def create_screenshot_folder(dir, screenshot_name: str="screenshots/"):
finally:
return str(screenshot_folder)
def write_to_file(path: str, value: any):
"""
Write the value to a file.
"""
with open(path, "w") as file:
file.write(value)
# --- NOT USED CURRENTLY ---
def get_added_modified_svgs(files_added_json_path: str,
files_modified_json_path: str):
"""
@@ -230,11 +238,3 @@ def get_added_modified_svgs(files_added_json_path: str,
svgs.append(path)
return svgs
def write_to_file(path: str, value: any):
"""
Write the value to a file.
"""
with open(path, "w") as file:
file.write(value)