Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
17 changes: 0 additions & 17 deletions .github/ISSUE_TEMPLATE/bug_report.md

This file was deleted.

17 changes: 0 additions & 17 deletions .github/ISSUE_TEMPLATE/feature_request.md

This file was deleted.

9 changes: 5 additions & 4 deletions .github/ISSUE_TEMPLATE/icon-request.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: Icon Request
name: Icon request
about: Requesting a new icon or changes to an existing icon
title: 'Icon request: [NAME]'
labels: 'request:icon'
Expand All @@ -8,7 +8,8 @@ assignees: ''
---

### About the icon
*Short description of why you think this icon belongs in our project.*

*Short description why you think this icon is matching in our project*
### Links
*Provide links to the icon's official website/repository. Anywhere that shows us what the technology is about and its official logo. If available, also provide some resources (SVG's) where the icon can be found (Font Awesome, Icomoon, etc..).*
*Provide helpful links which can be used to take a deeper look into the icon and provide, if available, some resources (svg's) where the icon can be found*
### Preview
*If available, provide some images of the icon you would like to be added*
17 changes: 0 additions & 17 deletions .github/PULL_REQUEST_TEMPLATE/new_feature.md

This file was deleted.

22 changes: 0 additions & 22 deletions .github/PULL_REQUEST_TEMPLATE/new_icon.md

This file was deleted.

37 changes: 37 additions & 0 deletions .github/drafts/check_devicon_object.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
from typing import List

# abandoned since it's not too hard to check devicon objects using our eyes
# however, still keep in case we need it in the future

def check_devicon_objects(icons: List[dict]):
"""
Check that the devicon objects added is up to standard.
"""
err_msgs = []
for icon in icons:
if type(icon["name"]) != str:
err_msgs.append("'name' must be a string, not: " + str(icon["name"]))

try:
for tag in icon["tags"]:
if type(tag) != str:
raise TypeError()
except TypeError:
err_msgs.append("'tags' must be an array of strings, not: " + str(icon["tags"]))
break


if type(icon["versions"]["svg"]) != list or len(icon["versions"]["svg"]) == 0:
err_msgs.append("Icon name must be a string")

if type(icon["versions"]["font"]) != list or len(icon["versions"]["svg"]) == 0:
err_msgs.append("Icon name must be a string")

if type(icon["color"]) != str or "#" not in icon["color"]:
err_msgs.append("'color' must be a string in the format '#abcdef'")

if type(icon["aliases"]) != list:
err_msgs.append("'aliases' must be an array of dicts")

if len(err_msgs) > 0:
raise Exception("Error found in devicon.json: \n" + "\n".join(err_msgs))
26 changes: 26 additions & 0 deletions .github/drafts/check_svgs_monthly.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import traceback
import sys

# pycharm complains that build_assets is an unresolved ref
# don't worry about it, the script still runs
from build_assets import filehandler, arg_getters
from build_assets import util


def main():
"""
Check the quality of the svgs of the whole icons folder.
"""
args = arg_getters.get_check_svgs_monthly_args()

try:
devicon_json = filehandler.get_json_file_content(args.devicon_json_path)
svgs = filehandler.get_svgs_paths(devicon_json, args.icons_folder_path)
util.check_svgs(svgs)
print("All SVGs found were good. Task completed.")
except Exception as e:
util.exit_with_err(e)


if __name__ == "__main__":
main()
42 changes: 42 additions & 0 deletions .github/drafts/check_svgs_monthly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Check SVGs Monthly
on: workflow_dispatch
# schedule:
# - cron: '0 0 1 * *'
jobs:
check_develop:
name: Check the SVGs' quality in the `develop` branch
runs-on: ubuntu-18.04
steps:

- uses: actions/checkout@v2
with:
ref: develop

- uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Install dependencies
run: python -m pip install --upgrade pip

- name: Run the check_svg script
run: >
python ./.github/scripts/check_svgs_monthly.py ./devicon.json ./icons

check_master:
name: Check the SVGs' quality in the `master` branch
runs-on: ubuntu-18.04
steps:

- uses: actions/checkout@v2 # check out default branch, which is master

- uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Install dependencies
run: python -m pip install --upgrade pip

- name: Run the check_svg script
run: >
python ./.github/scripts/check_svgs_monthly.py ./icomoon.json ./devicon.json ./icons
109 changes: 109 additions & 0 deletions .github/drafts/peek_icons imgur.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
name: Peek Icons
on:
pull_request:
types: [labeled]
jobs:
build:
name: Get Fonts From Icomoon
if: contains(github.event.pull_request.labels.*.name, 'bot:peek')
runs-on: windows-2019
steps:
- uses: actions/checkout@v2
- name: Setup Python v3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r ./.github/scripts/requirements.txt
- name: Run icomoon_peek.py
env:
PR_TITLE: ${{ github.event.pull_request.title }}
shell: cmd
run: >
python ./.github/scripts/icomoon_peek.py
./.github/scripts/build_assets/geckodriver-v0.27.0-win64/geckodriver.exe ./icomoon.json
./devicon.json ./icons ./ --headless --pr_title "%PR_TITLE%"
- name: Upload geckodriver.log for debugging purposes
uses: actions/upload-artifact@v2
if: failure()
with:
name: geckodriver-log
path: ./geckodriver.log
- name: Upload screenshot of the newly made icons
id: icons_overview_img_step
uses: devicons/public-upload-to-imgur@v2.1
if: success()
with:
path: ./screenshots/new_icons.png
client_id: ${{secrets.IMGUR_CLIENT_ID}}
- name: Upload zoomed in screenshot of the newly made icons
id: icons_detailed_img_step
uses: devicons/public-upload-to-imgur@v2.1
if: success()
with:
path: ./screenshots/screenshot_*.png
client_id: ${{secrets.IMGUR_CLIENT_ID}}
- name: Generate the markdowns for the screenshot and put it in the DETAILED_IMGS_MARKDOWN env var
if: success()
env:
IMG_URLS: ${{ steps.icons_detailed_img_step.outputs.imgur_urls }}
run: |
echo 'DETAILED_IMGS_MARKDOWN<<EOF' >> $GITHUB_ENV
python ./.github/scripts/generate_screenshot_markdown.py >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
shell: bash
- name: Comment on the PR about the result
if: success()
uses: github-actions-up-and-running/pr-comment@v1.0.1
env:
OVERVIEW_IMG_URL: ${{ fromJSON(steps.icons_overview_img_step.outputs.imgur_urls)[0] }}
MESSAGE: |
Hi!

I'm Devicons' Peek Bot and I just peeked at the icons that you wanted to add using [icomoon.io](https://icomoon.io/app/#/select).
Here is the result below:

![Peeked Icons (top left)]({0})

Here are the zoomed-in screenshots of the added icons:
{1}

Note: If the images don't show up, it's probably because it has been autodeleted by Imgur after 6 months due to our API choice.

The maintainers will now take a look at it and decide whether to merge your PR.

Thank you for contributing to Devicon! I hope everything works out and your icons are accepted into the repo.

Cheers :),

Peek Bot
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
message: ${{format(env.MESSAGE, env.OVERVIEW_IMG_URL, env.DETAILED_IMGS_MARKDOWN)}}
- name: Comment on the PR about the result
if: failure()
uses: github-actions-up-and-running/pr-comment@v1.0.1
env:
MESSAGE: |
Hi!

I'm Devicons' Peek Bot and it seems we've ran into a problem. I'm supposed to check your svgs but I couldn't do my task due to an issue.

Can you please double check and fix the possible issues below:

- Your svgs are named and added correctly to the /icons folder as seen [here](https://github.com/devicons/devicon/blob/master/CONTRIBUTING.md#orgGuidelines).
- Your icon information has been added to the `devicon.json` as seen [here](https://github.com/devicons/devicon/blob/master/CONTRIBUTING.md#updateDevicon)
- Your PR title follows the format seen [here](https://github.com/devicons/devicon/blob/master/CONTRIBUTING.md#overview)

Once everything is fixed, the maintainers will try again. If I still fail, the maintainers will investigate what cause this problem.

Thank you for your help :smile:

Cheers :),

Peek Bot
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
message: ${{env.MESSAGE}}
Loading