Last Friday, I embarrassingly failed to manually parse a JSON because I struggled with its formatting. The JSON in this repo varies in its formatting and can make some of these queries difficult to parse quickly. To help with this issue, this PR adds a pre-commit hook to auto-format any staged JSON using pre-commit and its prettier plugin
In practice it works as follows:
user stages unformatted JSON
user commits
pre-commit runs and detects unformatted JSON
pre-commit calls prettier to format JSON
pre-commit unstages JSON
the commit fails
user stages JSON
user commits
commit succeeds
Since @MarkDWilliams is essentially the only person who commits to this repository, I thought it would be a good test case for translator to see if it could be adopted more widely (e.g. minihackathon repo) if a single-user repo is successful.
I will make comments on the individual files to explain their function.
Please feel free to reject this PR if you think it will inhibit your workflow. It's just a suggestion that I think could make life easier, but I understand it complicates a widely used repo.
@MarkDWilliams, if you choose to merge this PR, it might be a good idea to do the following on a formatting branch after setting up precommit per the README:
pre-commit run --all-files
Bonus: you get a free dark green block on your git profile :)
Last Friday, I embarrassingly failed to manually parse a JSON because I struggled with its formatting. The JSON in this repo varies in its formatting and can make some of these queries difficult to parse quickly. To help with this issue, this PR adds a pre-commit hook to auto-format any staged JSON using pre-commit and its prettier plugin
In practice it works as follows:
Since @MarkDWilliams is essentially the only person who commits to this repository, I thought it would be a good test case for translator to see if it could be adopted more widely (e.g. minihackathon repo) if a single-user repo is successful.
I will make comments on the individual files to explain their function.
Please feel free to reject this PR if you think it will inhibit your workflow. It's just a suggestion that I think could make life easier, but I understand it complicates a widely used repo.
@MarkDWilliams, if you choose to merge this PR, it might be a good idea to do the following on a formatting branch after setting up precommit per the README:
Bonus: you get a free dark green block on your git profile :)