3 ms·
I have a perfect solution for this, that works for me at least. Adding a `..` to the end of a variable triggers a macro that changes `val` into something like
by stitched2gethr 2y ago
I have a perfect solution for this, that works for me at least.
Adding a `..` to the end of a variable triggers a macro that changes `val` into something like `print("val:", val) // FIXME: REMOVE`. Then a pre-commit hook makes sure I am unable to commit lines matching this pattern.
- deleted 2y ago[deleted]
- johnisgood 2y agoThat could work, but there is a problem with this approach (the last part of it): Not all projects use git, but the ones that do: It is possible to set up a global pre-commit hook in git, but it requires some manual configuration because git does not natively support global hooks out of the box. By default, hooks are local to each repository and reside in the .git/hooks directory. You could do: git config --global core.hooksPath ~/.git-hooks But... setting `core.hooksPath` overrides the use of local hooks in .git/hooks. At least you can combine global and local hooks by modifying your global hook scripts to manually invoke the local hooks.
- never_inline 2y agoThere's a python tool called `pre-commit` which may be helpful. Its used very much in python ecosystem.