-
Notifications
You must be signed in to change notification settings - Fork 15
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
initial pre-commit config #266
base: main
Are you sure you want to change the base?
initial pre-commit config #266
Conversation
check out #270, which adds "./bin/pre-commit" to run pre-commit regardless of whether you are using a devcontainer or singularity |
we should ignore everything in |
50218f7
to
38639c8
Compare
Can pre-commit check for Unicode characters? A common problem is when a cut/paste from, e.g., the ISA manual, brings in Unicode to the YAML. That sometimes messes with the tools. |
The default |
It might, but I'm not sure. The problem arises when we try to load a YAML file with non-ASCII characters using the standard Ruby YAML library (which itself is just a wrapper around the C libyaml library). It will fail, but unfortunately without a helpful error message. I see that the library used by pre-commit -- ruamel.yaml -- has some pretty cool features like key order preservation and comment preservation. It could be a part of a solution to the "scripting changes" problem I've been concerned about. It's easy enough to make a little script to check for Unicode. Probably easier to do that then search around for something turn-key ready. How about this: I'll make the script and you figure out how to run it from pre-commit? |
I think we might need to discuss this more. My concern is YAML and AsciiDoc are both fully capable of supporting unicode and given these are the "docs" putting the ascii only restriction on the content seems problematic, especially if we want to support tooling that could be used to generate docs in other languages. |
Good point. Maybe I'll just figure out why it's failing ;) It should be able to handle UTF-8, after all... |
ecbd995
to
57a785a
Compare
@dhower-qc : this PR should be good to go as we discussed. Broke up into 2 commit: one for hooks added, one for autofix changes from those hooks |
When I try this, pre-commit doesn't seem to do anything:
Same with |
No after you pulled in 2f735f8 you should have seen this:
But I'm not running |
soft launch meaning only people with pre-commit tool installed would see this run. (full launch would entail, running pre-commit on all files to clean up past and github action to enforce pre-commit)
If you want to see full effect on files run:
pre-commit run --all-files
I looked the results of this over and changes seem fine.There's a lot of formatting changes to the html. (but some of the html looks minified so to be expected) I'd suggest maintainers look over what the changes would be for all the files and the generate final docs.
fixes #260