Posted by fotuzlab on May 10, 2012 at 11:39am
Was wondering if we could include pre-commit git hooks in module/theme repositories to check drupal coding standards. (Like the ones provided by http://drupal.org/project/git_hooks).
This would help in standardizing the code on d.o
The only problem I find is ... new contributors may find it irritating and hence put them off.
Thoughts???
Comments
Moving this question from the
Moving this question from the Drupal Association group to the Drupal.org improvements and Drupal.org Git Team groups.
Thanx. My bad! Didn't know
Thanx. My bad! Didn't know Drupal.org Improvements exist.
http://goo.gl/icjPn
Setup
Pre-commit hooks need to be setup in everybody's own environment. So that would not scale.
And as you mention we don't want make it harder to contribute.
I think I would prefer a post-receive hook that kicks off a few test.
Giving a gentle hint about code style would be helpful in my opinion.
Why not integrate that with the "Automated testing" tab we already have?
"Pre-commit hooks need to be
"Pre-commit hooks need to be setup in everybody's own environment. So that would not scale."
Thats right! I was hoping if we could just clone these hooks at the time of checkout.
Nonetheless, adding a post receive hook sounds better. Send it as an email?
http://goo.gl/icjPn
There is a problem with tests
There is a problem with tests and files from external libraries.
Sometimes they contain tabs and other problems on purpose.
Maybe we can add a special suffix to a patch to overcome that problem.
For example we could end those patches with -has-known-formatting-issues.
thisIsApatch-has-known-formatting-issues.patch
Sounds stupid but I think thats the best we can do. Or are there better options?
EDIT: on local commits this can lead to potential problems...