Conversation
|
Neat. What happens when you break one of the rules? Does it fix your commit for you? |
|
It looks like it edited some |
|
SVGs are XML files, interestingly. |
🤯 |
|
If there is a breakage it can either warn you and exit (for example for incorrect yaml) or edit the files itself (adding the newline/deleting the extra spaces). |
|
I also just enabled all the pre-commit hooks since I think there isn't much movement in the repo right now. So now could be a good time to just force formatting on everything. |
|
For reference on the Clang formatting: https://zed0.co.uk/clang-format-configurator/ |
|
Note that the documentation error is not due to this PR (the BOOM documentation / website is down for some reason) - This should be fixed in the next few hours / I had to re-buy the domain. |
jerryz123
left a comment
There was a problem hiding this comment.
I don't like forcing formatting on source code like this. No-trailing-whitespace is fine, but restructuring code and comments like this is too heavy-handed.
cf35bb3 to
292cc75
Compare
|
I personally think having a linter/code-formatter is better than not having one at all, but we can push that to a later discussion. For now this PR will just focus on whitespace management + checking files. |
|
@jerryz123 This is now ready for rereview |
jerryz123
left a comment
There was a problem hiding this comment.
Thanks for fixing all the trailing-whitespace/newline issues. The git hooks thing seems useful.
See firesim/firesim#1329 for original PR.
This PR adds pre-commit support (https://pre-commit.com/) to run pre-commit hooks. Look at the
.pre-commit-config.yamlfile to see how pre-commit hooks are enabled. For a list of other supported plugins see https://pre-commit.com/hooks.html. To enable the hooks you have to run pre-commit install so I added that command to theenv.shfile (this adds a small lag - ~O(s) - to the 1st time theenv.shis invoked but afterwards is a noop) (seebuild-setup.sh). Additionally, to run the hooks on all files in the repo I ranpre-commit run --all-files. Normally only the files that are committed are checked with the pre-commit hooks.Related PRs / Issues:
Type of change:
Impact:
Contributor Checklist:
mainas the base branch?changelog:<topic>label?changelog:label?.conda-lock.ymlfile if you updated the conda requirements file?Please Backport?