Hello Lex,
Thanks for the info. I'm planning to use phpCodeSniffer as a start. It's a command line tool that outputs errors and warnings about coding style after reading the PHP code. It's syntax is something like this phpcs file.php.
I wanted to create a more easy to use interface for this, maybe a plugin or something, that outputs such checks, once enabled, in the Geany warnings or something. I use the built-in terminal to check my code with phpcodesniffer, phpunit and other tools, but it's quite a pain to change everything once in a while.
ps.: Can i write a plugin to create more than one built-in terminal screens, with pre-scripted commands? For example, automatically create a built-in terminal window that runs the following command: watch -n 1 php FILE_BEING_EDITED.php (great debugging)
----- Original Message ----- From: Lex Trotman Sent: 08/02/11 09:26 PM To: Geany general discussion list Subject: Re: [Geany] Warnings and Errors in Geany
On 3 August 2011 06:21, Vincent P. Ellis vincent@linuxmail.org wrote: > Is there a plugin, or a built-in feature i missed, where i can have Warnings > and Errors checked for my code in Geany? I'm trying to attach > PHP_CodeSniffer to Geany and output the warnings and errors directly in the > window. > Hi Vincent, Only commands run from the build menu compile or make sections are checked for errors by regex or fallback to HHH (hairy hardcoded heuristics). Detected error lines are marked and the message in the message window is red and is a link to the source line. I'm not a PHP programmer so I don't know what the tool you mention does but if its anything like a compiler or lint program then add it to the filetype section (see the manual). Cheers Lex > Vincent Ellis > C/C++ Technician > vincent@linuxmail.org > El Paso, TX > _______________________________________________ > Geany mailing list > Geany@uvena.de > https://lists.uvena.de/cgi-bin/mailman/listinfo/geany > > _______________________________________________ Geany mailing list Geany@uvena.de https://lists.uvena.de/cgi-bin/mailman/listinfo/geany
Vincent Ellis C/C++ Technician vincent@linuxmail.org El Paso, TX
On 3 August 2011 11:47, Vincent P. Ellis vincent@linuxmail.org wrote:
Hello Lex,
Thanks for the info. I'm planning to use phpCodeSniffer as a start. It's a command line tool that outputs errors and warnings about coding style after reading the PHP code. It's syntax is something like this phpcs file.php.
I wanted to create a more easy to use interface for this, maybe a plugin or something, that outputs such checks, once enabled, in the Geany warnings or something. I use the built-in terminal to check my code with phpcodesniffer, phpunit and other tools, but it's quite a pain to change everything once in a while.
As I said, the Geany build system has the built in capability to run commands on the current file and parse the output for error messages. Whilst you can write your own plugin for the fun of it, maybe it would be better to try the inbuilt capability first.
ps.: Can i write a plugin to create more than one built-in terminal screens, with pre-scripted commands? For example, automatically create a built-in terminal window that runs the following command: watch -n 1 php FILE_BEING_EDITED.php (great debugging)
I'm not quite sure what you are wanting to do.
Cheers Lex
Set compile build command to: phpcs "%f" | sed -e 's/^/%f |/' | egrep 'WARNING|ERROR' And set Error Regular Expression to: (.+) [|]\s+([0-9]+)
Note: This probably only works on Linux/Unix