05-02-2015, 09:09 PM
I need volunteers. I have changed the CheckBasicStyle.lua script so that it can check individual files and even the files specifically being committed in Git. This comes handy as a git pre-commit hook - whenever you commit to git, CheckBasicStyle will check your commit before allowing you to actually commit it. And now I need people to test it out
To enable:
Update your repo (the support has just been added)
Go to your .git/hooks folder, create a text file "pre-commit" there with the following contents:
This is all it should take. If you want to disable the checks, just rename / remove the file.
Let me know how it works for you.
I've found one problem so far, but I consider it a highly unlikely scenario:
If you edit a file, stage it for commit, then edit it again and finally commit, Git will commit the staged version, while CheckBasicStyle will check the edited version. Is there anyone who actually uses this scenario? (I hope not
To enable:
Update your repo (the support has just been added)
Go to your .git/hooks folder, create a text file "pre-commit" there with the following contents:
Code:
#!/bin/sh
# Redirect output to stderr:
exec 1>&2
# Check the style of the files being committed:
exec src/CheckBasicStyle.lua -g
Let me know how it works for you.
I've found one problem so far, but I consider it a highly unlikely scenario:
If you edit a file, stage it for commit, then edit it again and finally commit, Git will commit the staged version, while CheckBasicStyle will check the edited version. Is there anyone who actually uses this scenario? (I hope not