Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(icons): ensure UI icons follow naming convention #10292

Merged
merged 3 commits into from
Sep 13, 2024

Conversation

jcfranco
Copy link
Member

@jcfranco jcfranco commented Sep 12, 2024

Related Issue: N/A

Summary

This updates our pre-commit hook to check SVG icons to make sure they follow the icon naming convention:

  • <iconName>-<size>.svg.
  • <iconName>-<size>-f.svg.

If an icon about to be committed does not match this format, the commit will fail and be canceled.

@github-actions github-actions bot added the chore Issues with changes that don't modify src or test files. label Sep 12, 2024
@jcfranco jcfranco added the skip visual snapshots Pull requests that do not need visual regression testing. label Sep 12, 2024
Copy link
Member

@benelan benelan left a comment

Choose a reason for hiding this comment

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

There were some quotes missing, but otherwise LGTM! I recommend shellcheck for catching linting issues like that.

.husky/pre-commit Outdated Show resolved Hide resolved
.husky/pre-commit Outdated Show resolved Hide resolved

STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM)

for file in $STAGED_FILES; do
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
for file in $STAGED_FILES; do
for file in "$STAGED_FILES"; do

Copy link
Member Author

Choose a reason for hiding this comment

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

Quoting this one gives me the following error:

Since you double quoted this, it will not word split, and the loop will only run once.

.husky/pre-commit Outdated Show resolved Hide resolved
.husky/pre-commit Outdated Show resolved Hide resolved
.husky/pre-commit Outdated Show resolved Hide resolved
.husky/pre-commit Outdated Show resolved Hide resolved
@jcfranco
Copy link
Member Author

I recommend shellcheck for catching linting issues like that.

Thanks for the rec! Could you share your config? A fresh install didn't complain about quotes, so I might be missing something.

@jcfranco jcfranco marked this pull request as ready for review September 13, 2024 08:13
@jcfranco jcfranco merged commit 0483ca0 into dev Sep 13, 2024
15 checks passed
@jcfranco jcfranco deleted the jcfranco/ensure-icon-files-follow-naming-convention branch September 13, 2024 19:11
benelan added a commit that referenced this pull request Sep 17, 2024
…estone-estimates

* origin/dev: (997 commits)
  fix: correct non-standard filled icon names (#10309)
  fix(panel): initially closed panel should be hidden (#10308)
  chore(linting): automate tracking of custom Sass functions for stylelint (#10313)
  chore: tidy up demo pages (#10314)
  build(deps): update dependency dayjs to v1.11.13 (#10283)
  build(deps): update dependency jsdom to v24.1.3 (#10298)
  build(deps): update dependency husky to v9.1.6 (#10318)
  build(deps): update angular-cli monorepo to v18.2.4 (#10317)
  docs: update component READMEs (#10316)
  refactor(stylelint): change config to module format to enable more dynamic options (#10311)
  refactor: fixup typescript errors (#10295)
  build(deps): update dependency lint-staged to v15.2.10 (#10302)
  build(deps): update dependency focus-trap to v7.6.0 (#10281)
  build(deps): update dependency husky to v9.1.5 (#10297)
  chore: release next
  feat(checkbox): add component tokens (#10221)
  revert: "chore: set default page size for E2E tests (#10219)" (#10299)
  chore(icons): ensure UI icons follow naming convention (#10292)
  chore: release next
  feat: add model-history, raster-function-history, raster function-template-history, raster-tool-history, tool-history (#10305)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Issues with changes that don't modify src or test files. skip visual snapshots Pull requests that do not need visual regression testing.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants