Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
howtos:check_python_code [2013/05/20 13:11] – Reformat "Setup Geany" section as a numbered list dregadhowtos:check_python_code [2014/10/25 14:13] – add pylint.bat for Windows enrico
Line 23: Line 23:
 pyflakes $1 pyflakes $1
 echo "======  pylint  ======" echo "======  pylint  ======"
-pylint --output-format=parseable $1+pylint --msg-template="{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}" --reports=n $1
 </file> </file>
  
Line 34: Line 34:
 export PYTHONPATH="$PYTHONPATH:/home/username/.pylint.d" export PYTHONPATH="$PYTHONPATH:/home/username/.pylint.d"
 </code> </code>
 +
  
  
Line 46: Line 47:
     * Set the Command field to <code>     * Set the Command field to <code>
 check_python_code %f check_python_code %f
-</code> Note: this assumes that you saved the above mentioned helper script into a path in your $PATH environment variable. If not, just specify the full path to the script. %f is a placeholder replaced by Geany on execution with the filename of the current file in the editor.+</code> Note: this assumes that you saved the above mentioned helper script into a path in your $PATH environment variable. If not, just specify the full path to the script. %f is a placeholder replaced by Geany on execution with the filename of the current file in the editor. OR You can also use each command i.e. `pep8`, `pyflakes` or `pylint` directly in place of `check_python_code` 
   - Paste the following text in the "Error regular expression" field. <code>   - Paste the following text in the "Error regular expression" field. <code>
 ([^:]+):([0-9]+):([0-9:]+)? .* ([^:]+):([0-9]+):([0-9:]+)? .*
Line 52: Line 53:
  
  
 +==== Using pylint on Windows ====
 +
 +Gösta Ljungdahl mentioned, the following little batch script is useful to use pylint on Windows with Geany:
 +
 +<code dos pylint.bat>
 +@echo off
 +set configfile=c:\cygwin64\home\gostal\.pylintrc
 +echo "======  pylint  ======"
 +c:\Anaconda\envs\python3\Scripts\pylint.exe --rcfile=%configfile% --msg-template="{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}" %1
 +</code>
 +
 +Of course, you need to tweak the paths to the config file and pylint.exe.
 +The rest should be similar to the explainations above.
  
  
Print/export