1
0
mirror of https://github.com/konpa/devicon.git synced 2025-08-14 18:44:17 +02:00

Added check script for the icons and fix icons with fill or viewBox issues (#460)

* Added script to check svg fill and viewBox

* Fix cucumber-plain-wordmark

* Fix various fill and viewBox issues in svgs

* Added check for height and width attr

* Added check_svgs workflow

* Fix an issue where the error is not log properly

* Added on push for testing

* Updated trigger so it now runs whenever PR is update

* Added sleep to script to make logs nicer

* Added script that create env var

* Updated the github_env to accomodate ubuntu

* Change format of log and allow filehandler to return Path

* Updated logging messages

* Updated refs for the checkout action

* Make logging nicer

* Updated fix messaging so it's more clear

* fix icons: icons/cucumber/cucumber-plain-wordmark.svg, icons/intellij/intellij-plain-wordmark.svg, icons/jenkins/jenkins-plain.svg, icons/twitter/twitter-original.svg, icons/yunohost/yunohost-plain.svg
This commit is contained in:
Thomas Bui
2021-01-08 12:36:45 -08:00
committed by GitHub
parent 1eedcd8b4a
commit 82bccb11fd
17 changed files with 397 additions and 419 deletions

View File

@@ -2,6 +2,7 @@ from typing import List
import re
import sys
from selenium.common.exceptions import TimeoutException
import xml.etree.ElementTree as et
# pycharm complains that build_assets is an unresolved ref
# don't worry about it, the script still runs
@@ -21,7 +22,7 @@ def main():
if len(filtered_icons) == 0:
message = "No icons found matching the icon name in the PR's title.\n" \
"Ensure that the PR title matches the convention here: \n" \
"Ensure that a new icon entry is added in the devicon.json and the PR title matches the convention here: \n" \
"https://github.com/devicons/devicon/blob/master/CONTRIBUTING.md#overview.\n" \
"Ending script...\n"
sys.exit(message)
@@ -33,14 +34,14 @@ def main():
runner = None
try:
runner = SeleniumRunner(args.download_path, args.geckodriver_path, args.headless)
svgs = filehandler.get_svgs_paths(filtered_icons, args.icons_folder_path)
svgs = filehandler.get_svgs_paths(filtered_icons, args.icons_folder_path, True)
screenshot_folder = filehandler.create_screenshot_folder("./")
runner.upload_svgs(svgs, screenshot_folder)
print("Task completed.")
except TimeoutException as e:
sys.exit("Selenium Time Out Error: \n" + str(e))
except Exception as e:
sys.exit(e)
sys.exit(str(e))
finally:
runner.close()
@@ -62,5 +63,7 @@ def find_object_added_in_this_pr(icons: List[dict], pr_title: str):
return []
if __name__ == "__main__":
main()