ehn-dcc-development / eu-dcc-schema

Schema for the ehn DCC payload
Apache License 2.0
165 stars 59 forks source link

Automatically format the JSON files before commit #142

Closed ryanbnl closed 1 year ago

ryanbnl commented 2 years ago

Add a command to the make + with a shell/batch file which formats the json files as per the standard used for this repository. The make file already does a check, the same method can be used to rewrite the files.

ryanbnl commented 2 years ago

Update the documentation in the readme at the same time (extra dependencies + document all the make commands + section for developers for the process).

ryanbnl commented 2 years ago

The end result should be hang-over tolerant.

ryanbnl commented 2 years ago

Given this a little more thought - a pre-commit hook which runs the check command (and fails the commit if the formatting isn't correct) is better. I'm not comfortable with automatically rewriting a file.

dslmeinte commented 2 years ago

Agree that a Git pre-commit hook is the best solution here.

ryanbnl commented 2 years ago

Also makes more sense to run all of the expected checks there. Draft PR coming, testing later or tomorrow (different machine and I want to get through some other things too).