Automatic formatting of Linux code (PHP, JavaScript, HTML, CSS, MySQL)
I am looking for a Linux or PHP program to automate code formatting. It would handle many languages ββoptimally, but the priority (highest): PHP, JavaScript, HTML, CSS, and MySQL. Comparability is good, but not the most important feature.
Context / Usage: Automation with Subversion post-commit. I work with teams and want to always follow the same formatting method.
source to share
Astyle is the canonical answer if you only insist on one thing.
You probably can't get one formatter for many languages ββthat understands their syntax, and you can't afford to get the syntax wrong because you don't want the formatter to break your code (especially after it has just been tested in! ) [Astyle works on several because it only accepts C-like langauges]. See Semantic Designs Formatters for such tools for many languages ββthat understand the syntax exactly and cannot make such mistakes.
source to share