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.

+2


source to share


3 answers


I find that using an IDE like Eclipse or Aptana will accomplish this task very easily. It's not automated, but if all developers use an IDE, it's very easy.



0


source


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.

0


source


Check out Geany . It is in the Ubuntu repositories and its best PHP IDE that I have used so far.

0


source







All Articles