Page 1 of 1

Better auto format rules

Posted: Mon Dec 14, 2015 5:21 pm
by AcsPrime
Hey guys,

Your ide really seems like a great piece of software.

I am coming from netbeans and in netbeans it would be possible to configure the auto format to format according to some rules.

For example, I would go to this website: https://maniaplanet.github.io/netbeans-psr/ and just import the settings for the formater and have my php code all nicely formated according to the PSR conventions.
I did look at the plugin "Source code formatter" but the options seemed a bit simple. Is there any other plugin that would allow me to customize how the auto formatter works a bit more in-depth?

Re: Better auto format rules

Posted: Mon Dec 14, 2015 6:32 pm
by eranif
CodeLite supports 2 foramtters for PHP:

The built-in formatter which is a simple formatter with not much rules
The second is called PHP-CS-Fixer https://github.com/FriendsOfPHP/PHP-CS-Fixer which you can configure with many options

Have you tried using the later?

Eran

Re: Better auto format rules

Posted: Tue Dec 15, 2015 4:58 pm
by AcsPrime
I can try, but you pointed to a php github repo.
I am confused.. does code lite have some configuration dialog for this?

Re: Better auto format rules

Posted: Tue Dec 15, 2015 5:28 pm
by eranif
plugins->source code formatter
In the "General" page, select under "PHP Formatter" select the "PHP-CS-Fixer" option.
Next, configure the the code PHP-CS-Fixer: plugins->source code formatter->php->php-cs-fixer:

PHP Executable: select the PHP executable
PHP-CS-Fixer phar file: select the path to the phar file

and then you can add arguments from the link I provided

Eran