4 ms·
Ask HN: do you use the 'format code' feature of your IDE?
I am using PhpStorm and sometimes I hit the 'Reformat Code' command. The outcome is good, but eventually I am writing some WordPress-related code and it doesn't comply with the formatting guidelines of WordPress [1].
Do you use any formatting feature of your IDE, or do you format the code manually?
[1] http://make.wordpress.org/core/handbook/coding-standards/
- Artemis2 12y agoI'm currently programming in Go, and Google provides very strict constrains for its syntax (e.g. no braces on a new line, etc.). To take this a step further, my editors automatically runs the go fmt tool on saved files, which formats the code according to the guidelines for the style. That means indenting with tabs, aligning with spaces... That's very pleasing that a language in an early stage has this kind of tools, because if I need to copy a code snippet from the web, it will almost everytime be formatted exactly like my own code. Same when I work with somebody else: no discussion over code formatting.
- ziodave 12y agoI can see something similar exists for PHP/WordPress https://github.com/squizlabs/PHP_CodeSniffer https://github.com/squizlabs/PHP_CodeSniffer