-
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
add automation for consistent formatting and linting #260
Comments
Love that idea. As mentioned in Issue #246, it might also be nice to have the keys sorted in YAML files to ensure scripted changes produce reasonable diffs (Since different YAML libraries will likely emit in different orders). |
I did some exploration of yaml formatting with following tools: Here's my findings:
My recommendation based on this would be to move ahead with prettier formatting and writing a custom script to enforce keyword sorting with a specific ordering for some keyword if needed. |
soft launch meaning only people with pre-commit tool installed would see this run. If you want to see full effect on files run: `pre-commit run --all-files` fixes riscv-software-src#260
soft launch meaning only people with pre-commit tool installed would see this run. (full launch would entail, running pre-commit on all files 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 riscv-software-src#260
soft launch meaning only people with pre-commit tool installed would see this run. (full launch would entail, running pre-commit on all files 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 riscv-software-src#260
Discussed this more with maintainers and going to reduce the number of hooks in this initial PR to just very simple:
The other hooks in this initial can then be put in later PRs. |
Consistently formatted yaml, json, etc makes it easier for multiple developers and reduces git diffs.
Formatting and linting that can be run on at git commit time with a git hook, reduces the need for this later in PRs (Github action can be used to confirms that it was done)
There are tools to manage pre-commit hooks like:
Since this project is a multilingual project:
I would suggest using pre-commit to manage the hooks but I'm open to exploring other tooling. (I do realize that since pre-commit is python based I'd be adding another language to the dev dependencies)
I'm happy to put in a PR once the discussion done.
The text was updated successfully, but these errors were encountered: