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 Json validator #527

Merged
merged 4 commits into from Sep 13, 2017

Conversation

2 participants
@ericcornelissen
Copy link
Contributor

ericcornelissen commented Sep 13, 2017

In response to #521, I added a JSON validator to validate the validity of _data/simple-icons.json that could/should be used with Continuous Integration (currently configured for Travis CI, but we could change to e.g. CircleCI or AppVeyor). You can see it effects here or in the screenshot below (I intentionally made a commit with an incorrect .json file)
preview

I used jsonlint for this, which I added as a devDependency to the project in package.json. To make it easier to use I also added a npm script called jsonlint which automatically lints _data/simple-icons.json (without this script the command would have to look something like node_modules/.bin/jsonlint _data/simple-icons.json -q in case jsonlint is not available globally).

In the future we could even make use of JSON Schemes (which jsonlint supports 馃憤) to enforce e.g. certain data types on certain fields. You can find out more here and here.

@birjolaxew birjolaxew merged commit 6e5f68d into simple-icons:develop Sep 13, 2017

@birjolaxew

This comment has been minimized.

Copy link
Member

birjolaxew commented Sep 13, 2017

馃憤 Thanks for implementing the linting! I've had this planned for a bit, but it's great that someone else got it done before me :) Really appreciated!

On a related note, svglint is being worked on - at this point, the only things missing is implementing the rules (and fix any problems/redesigns that arise from that)

@ericcornelissen ericcornelissen deleted the ericcornelissen:json-validator branch Sep 13, 2017

@ericcornelissen

This comment has been minimized.

Copy link
Contributor Author

ericcornelissen commented Sep 13, 2017

Great @birjolaxew 馃憤

Btw, do you want me to write up an issue for the JSON schemas, or are you not interested in using that?

@birjolaxew

This comment has been minimized.

Copy link
Member

birjolaxew commented Sep 13, 2017

That would be neat @ericcornelissen!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment