You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Don't get me wrong.
Maybe we should change some of the rules because they don't make sense.
There are hundreds of // in existing code.
At the moment it's even possible to introduce a runtime syntax error
in a stable version by a wrong commit.
So introducing a "wrong" comment isn't really a problem compared to this.
Rules should be checked as early as possible when developing
when writing the code (IDE)
when commiting (hooks)
when pushing
in build process
in delivery process
in installation process
during runtime
As long as we don't check anything, there will always occur commits that
brake rules.
Do you have any suggestions on how to improve that? I'm all ears.
On Sun, Aug 12, 2012 at 1:56 PM, Roland Becker ***@***.***:
Don't get me wrong.
Maybe we should change some of the rules because they don't make sense.
There are hundreds of // in existing code.
At the moment it's even possible to introduce a runtime syntax error
in a stable version by a wrong commit.
So introducing a "wrong" comment isn't really a problem compared to this.
Rules should be checked as early as possible when developing
1. when writing the code (IDE)
2. when commiting (hooks)
3. when pushing
4. in build process
5. in delivery process
6. in installation process
7. during runtime
As long as we don't check anything, there will always occur commits that
brake rules.
—
Reply to this email directly or view it on GitHubhttps://github.com/mantisbt/mantisbt/commit/05f7c33c7cae0071d8970c1ee87b274059a0556d#commitcomment-1702706.
The smartest way of doing this, would be to use a pre-commit hook that would take care of e.g. automatic syntax check of php files, and any other tasks we might want to define.
However, the hooks are not distributed and installed automatically - it is the individual responsibility of each developer to set things up (quote from git-scm book: "hooks aren’t transferred with a clone of a project, you must distribute these scripts some other way and then have your users copy them to their .git/hooks directory and make them executable.")
For even more strict control, a pre-receive hook would be even better, but that is not supported by github.
Setting up a job on the server may also be an option, making the checks a part of the nightly build script would be best I think.
I had a look at CodeSniffer docs and it looks like a good tool, but seems like a lot of work to set up the "sniffs" to match our standards, especially considering that "Most of the sniffs written for PHP_CodeSniffer do not support the usage of tabs for indentation and alignment. You can write your own sniffs that check for tabs instead of spaces" (see http://pear.php.net/manual/en/package.php.php-codesniffer.advanced-usage.php)
Maybe we should consider to revise our standards ;-)
And maybe we should move this discussion to the mailing list.
8 commit comments
atrol commentedon Aug 11, 2012
I like the // line comments, but not our conventions
http://www.mantisbt.org/guidelines.php
rombert commentedon Aug 11, 2012
atrol commentedon Aug 12, 2012
Don't get me wrong.
Maybe we should change some of the rules because they don't make sense.
There are hundreds of // in existing code.
At the moment it's even possible to introduce a runtime syntax error
in a stable version by a wrong commit.
So introducing a "wrong" comment isn't really a problem compared to this.
Rules should be checked as early as possible when developing
As long as we don't check anything, there will always occur commits that
brake rules.
rombert commentedon Aug 21, 2012
atrol commentedon Sep 18, 2012
Suggestions: yes, enough time to implement: No :-(
A very very small start: A script which could run in nightly build to avoid syntax errors in delivery: https://github.com/atrol/Tools/blob/master/bin/check_php_syntax.sh
This is the right tool to check violations of coding standards: http://pear.php.net/package/PHP_CodeSniffer
dregad commentedon Sep 19, 2012
The smartest way of doing this, would be to use a pre-commit hook that would take care of e.g. automatic syntax check of php files, and any other tasks we might want to define.
However, the hooks are not distributed and installed automatically - it is the individual responsibility of each developer to set things up (quote from git-scm book: "hooks aren’t transferred with a clone of a project, you must distribute these scripts some other way and then have your users copy them to their .git/hooks directory and make them executable.")
For even more strict control, a pre-receive hook would be even better, but that is not supported by github.
Setting up a job on the server may also be an option, making the checks a part of the nightly build script would be best I think.
git hooks reference: http://git-scm.com/book/en/Customizing-Git-Git-Hooks
dregad commentedon Sep 19, 2012
I had a look at CodeSniffer docs and it looks like a good tool, but seems like a lot of work to set up the "sniffs" to match our standards, especially considering that "Most of the sniffs written for PHP_CodeSniffer do not support the usage of tabs for indentation and alignment. You can write your own sniffs that check for tabs instead of spaces" (see http://pear.php.net/manual/en/package.php.php-codesniffer.advanced-usage.php)
Maybe we should consider to revise our standards ;-)
And maybe we should move this discussion to the mailing list.
bieli commentedon Sep 21, 2012
Yes, I'll recommend CodeSniffer for PHP language. I'm using this solution since three years in four companies - we need use consequent coding method.