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

Proposal: Check outlying precision while running linter #3750

Merged

Conversation

service-paradis
Copy link
Member

Issue: #3120, #3169

Description

Only a proposal and some adjustments might be needed.

I added a custom lint check to verify the average precision level. I report an error and update the ignored list if the average precision level is below or above a defined treshold. I used the values that were indicated in #3120. The error reported looks like this:
Precision level should be between ${iconMinFloatPrecision} and ${iconMaxFloatPrecision}; the average is currently ${precisionAverage}

Ex.
image

@ericcornelissen ericcornelissen added the meta Issues or pull requests regarding the project or repository itself label Oct 20, 2020
.svglintrc.js Outdated Show resolved Hide resolved
@github-actions github-actions bot added the update icon/data Issues or pull requests regarding icons that are outdated, this can be the SVG or color or both label Nov 10, 2020
.svglintrc.js Outdated Show resolved Hide resolved
.svglintrc.js Outdated Show resolved Hide resolved
@ericcornelissen ericcornelissen removed the update icon/data Issues or pull requests regarding icons that are outdated, this can be the SVG or color or both label Nov 18, 2020
Copy link
Contributor

@ericcornelissen ericcornelissen left a comment

Choose a reason for hiding this comment

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

Thanks for the detailed review so far @mondeja and thanks for the suggestion @service-paradis. I definitely like the upper bound to ensure small file sizes (whether 5 is the correct value is debatable but that can be changed if needed). I'm not so font of the lower bound, if an icon can work with a precision of 0 or 1 that's great! Unfortunately, I think we will need to leave icons with a precision that is too low to manual reviews... Thoughts?

Two question

package.json Outdated Show resolved Hide resolved
@ericcornelissen ericcornelissen added the dependencies Pull requests that update a dependency file label Nov 18, 2020
@mondeja
Copy link
Member

mondeja commented Nov 18, 2020

I think we will need to leave icons with a precision that is too low to manual reviews... Thoughts?

I agree with you, @ericcornelissen. Discrepances in 0.01 pixel ranges and lower are easy to check reviewing manually and can be uploaded an icon with path fitting entirely in integer points.

  • Is "average precision" the right choice here? Shouldn't we be looking at the maximum precision?
  • I'm surprised by the number of ignored cases...

@service-paradis
Copy link
Member Author

Thanks for the feedback!

  • I pinned svgpath version
  • I use only the maximum precision level instead of the average
  • I validate only if it is greater than the defined maximum

The number of ignored icon is way less this way!

.svglintrc.js Show resolved Hide resolved
.svglintrc.js Show resolved Hide resolved
.svglintrc.js Outdated Show resolved Hide resolved
.svglintrc.js Outdated Show resolved Hide resolved
@ericcornelissen ericcornelissen merged commit 9cee719 into simple-icons:develop Nov 19, 2020
@fbernhart fbernhart mentioned this pull request Dec 3, 2020
3 tasks
@service-paradis service-paradis deleted the lint-check-precision branch January 11, 2021 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file meta Issues or pull requests regarding the project or repository itself
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants