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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add linting step for extraneous elements in SVGs #3239

Merged
merged 4 commits into from Jun 22, 2020
Merged

Add linting step for extraneous elements in SVGs #3239

merged 4 commits into from Jun 22, 2020

Conversation

ericcornelissen
Copy link
Contributor

@ericcornelissen ericcornelissen commented Jun 21, 2020

Issue: Closes #3223

Description

This adds a new custom linter to the SVG linter (npm run svglint) that checks if SVGs start with <svg and end in </svg> (allowing for a single newline).

It works as expected, as illustrated by this build failure, which was fixed in 498561c (the icon had one trailing whitespace).

Suggested regarding the error message and reporter name are welcome 馃槃

... such as a trailing "s" in the Quasar SVG (#3221)
@ericcornelissen ericcornelissen added the meta Issues or pull requests regarding the project or repository itself label Jun 21, 2020
.svglintrc.js Outdated Show resolved Hide resolved
@PeterShaggyNoble
Copy link
Member

Other than the change above, this looks good to go to me. When I get around to reviewing the complete markup for all our icons, we may need to expand on this to include other checks.

Although, if we could somehow automate fixing niggly little things like this, that, I think, would be a better solution.

Co-authored-by: Peter Noble <PeterShaggyNoble@users.noreply.github.com>
@ericcornelissen
Copy link
Contributor Author

Other than the change above, this looks good to go to me.

Changed it 馃憤 Thanks for the suggestion

When I get around to reviewing the complete markup for all our icons, we may need to expand on this to include other checks.

I'd suggest defining a separate custom check for each of those.

Although, if we could somehow automate fixing niggly little things like this, that, I think, would be a better solution.

Even if we do that, it's still useful to have this 1) just in case and 2) for anyone to check their contributions locally.

Copy link
Member

@PeterShaggyNoble PeterShaggyNoble left a comment

Choose a reason for hiding this comment

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

This looks good to me now, Eric 馃憤 As it involves a change to our linting, though, let's get one of the other @simple-icons/maintainers to throw an eye over it, too.

I'd suggest defining a separate custom check for each of those.

My plan at the moment is to identify the problems in our existing icons and open an issue with a list for discussion on which ones we want to fix and which ones we want to add tests for (at which stage we can discuss the implementation also) then submit a PR to manually fix those icons and then begin working on the linting separately.

Copy link
Member

@runxel runxel left a comment

Choose a reason for hiding this comment

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

Thank you for the work! It looks great and is a fine addition [insert star wars meme here] 馃憤

@runxel runxel merged commit 01221c0 into simple-icons:develop Jun 22, 2020
github-actions bot added a commit that referenced this pull request Jun 28, 2020
# New Icons

- Cypress (#3228)
- NestJS (#3113)
- Qt (#3162)
- Sennheiser (#3045)

# Updated Icons

- BMC Software (#3239)
- Intercom (#3227)
ericcornelissen pushed a commit that referenced this pull request Jun 28, 2020
- Cypress (#3228)
- NestJS (#3113)
- Qt (#3162)
- Sennheiser (#3045)

- BMC Software (#3239)
- Intercom (#3227)
@ericcornelissen ericcornelissen deleted the lint-extraneous-elements branch July 2, 2020 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
meta Issues or pull requests regarding the project or repository itself
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add linting for extraneous elements in SVGs
3 participants