Skip to content

feat: reject identical base and alias in check_icon_pr - #2920

Merged
Yashh56 merged 3 commits into
devicons:developfrom
JagguDada01:JagguDada01/feature/check-bot-alias-base
Nov 29, 2026
Merged

Yashh56 merged 3 commits into
devicons:developfrom
JagguDada01:JagguDada01/feature/check-bot-alias-base

Conversation

@JagguDada01

@JagguDada01 JagguDada01 commented Nov 26, 2026 •

Copy link
Copy Markdown

Double check these details before you open a PR

  • PR does not match another non-stale PR currently opened

Features

Adds validation in check_icon_pr.py to reject devicon.json alias entries where "base" and "alias" have the same value, along with unit tests covering alias validation.

Problem

Previously, check_devicon_object allowed an icon entry in devicon.json to define an alias with identical "base" and "alias" values (for example {"base": "plain", "alias": "plain"}). Because aliases are intended to generate an additional font class from another SVG version, identical "base" and "alias" values only duplicate the same class name.

Root Cause

In .github/scripts/check_icon_pr.py, check_devicon_object validated that "base" and "alias" in each object of icon["aliases"] were strings matching (original|plain|line)(-wordmark)?, but never checked whether alias_objects["base"] == alias_objects["alias"].

Solution

  • Updated check_devicon_object in .github/scripts/check_icon_pr.py to check each dictionary entry in icon["aliases"] (when aliases is a list) and append an error message if both "base" and "alias" are strings with identical values.
  • Added regression unit tests in .github/scripts/tests/test_check_icon_pr.py using Python's standard-library unittest module.

Testing

  • Ran python3 -m unittest discover -s .github/scripts/tests -v (6 tests passed).
  • Ran pytest .github/scripts/tests/test_check_icon_pr.py -v (6 passed).
  • Ran check_icon_pr.check_devicon_object across all 726 entries in devicon.json (0 errors found).

This PR closes #1486

Closes #1486

@Yashh56 Yashh56 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

@Yashh56
Yashh56 requested review from a team, Snailedlt, canaleal, lunatic-fox and weh and removed request for a team November 27, 2026 06:54
@JagguDada01
JagguDada01 requested a review from Yashh56 November 28, 2026 23:29

@Yashh56 Yashh56 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀
Thanks For Your Contribution 🙇🏻

@Yashh56
Yashh56 merged commit 68e1822 into devicons:develop Nov 29, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants