Stream: nix

Topic: pre-commit-hooks to format the code


view this post on Zulip Hao Liu (May 23 2024 at 21:39):

I am trying to introduce a pre-commit-hooks check to stop user from pushing to remote if mal-formatted code found in the changes, the most promising checker I have found is https://github.com/editorconfig-checker/editorconfig-checker, while it doesn't honor the .editorconfig already there in the repo, it seems to be using its own set of rules

view this post on Zulip Srid (May 23 2024 at 21:52):

Looks like it supports .editorconfig file?

view this post on Zulip Hao Liu (May 23 2024 at 21:57):

@Srid it will use its own config file .ecrc instead of following the rules in .editorconfig

view this post on Zulip Srid (May 23 2024 at 21:58):

I'm not familiar with editorconfig, but why does it say this in the README?

This tool only needs your .editorconfig to check all files.

view this post on Zulip Hao Liu (May 23 2024 at 22:09):

image.png
turns out it does follow the rules in .editorconfig :)

view this post on Zulip Srid (May 23 2024 at 22:21):

For ref, https://github.com/juspay/superposition/pull/75


Last updated: Nov 15 2024 at 11:45 UTC