eu-dcc-schema icon indicating copy to clipboard operation
eu-dcc-schema copied to clipboard

Automatically format the JSON files before commit

Open ryanbnl opened this issue 3 years ago • 5 comments

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 avatar May 23 '22 14:05 ryanbnl

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

ryanbnl avatar May 23 '22 14:05 ryanbnl

The end result should be hang-over tolerant.

ryanbnl avatar May 23 '22 14:05 ryanbnl

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.

ryanbnl avatar Jun 08 '22 13:06 ryanbnl

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

dslmeinte avatar Jun 08 '22 14:06 dslmeinte

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).

ryanbnl avatar Jun 08 '22 14:06 ryanbnl