Good Practices

Eclipse

Its an editor good enough for Intel to use - its good enough for you. [Warning! Flame-bait detected! wink -- FrankHorowitz - 22 Nov 2006]

Update Manager

Is part of Eclipse that allows you to specify a remote site and it goes and finds packages.

see the Eclipse menu Help -> Software Updates -> Find and Install

Pydev plugin

Very handy if you are writing python code.

  • Help -> Software Updates -> Find and Install
  • Add the pydev site - http://pydev.sf.net/updates/
  • Install pydev
    • dont install the pydev extensions unless you want to pay for them
  • Restart Eclipse

Lint

Lint check your code for lots of things, from errors to performance loops.

Here are 2 versions we recommend using:
  • Lint4J (Java)
  • pylint (Python)

Installing Lint4J

If you are using eclipse this lint tool is available as a plugin.

Simply add this line to the eclipse update manager. http://www.jutils.com/eclipse-update

Using Lint4J

In eclipse, simply right click on the root folder of a project, and lint4j -> audit

Project specific options are available via the progect->properties->lint4j menu

Installing Pylint

The hosted website is always slow. Attached is the latest (13/10/2006) files required for python2.3

Instructions:
  • unzip the file.
  • run the exe FIRST.
  • cd logilab-common-0.19.3
  • run python setup.py install
  • cd ..\logilab-astng-0.16.1
  • run python setup.py install
  • cd ..\pylint-0.12.1
  • run python setup.py install

You will now have pylint in your local scripts folder.

Software group's RC file: https://cgsrv1.arrc.csiro.au/subversion/compgeo/trunk/PyAuditing/swteam.pylintrc

Using Pylint

With the scripts and pydev installed in eclipse - you are now able to do this Step 1
  • Window -> preferences -> Pydev -> Pylint
  • Enter the location of pylint (lint.py):
    • eg. C:\Python23\Lib\site-packages\pylint\lint.py
  • Also tick "Use Pylint?"
Step 2
  • Project->Properties->PyDev-PYTHONPATH
  • and add source folders to the list of sources (directories containing the python code you want checked), else PyLint will NOT start

PyLint will run when the files in the specfied directories are built

To use Pylint via the command: I recommend placing output in a files for each module and producing a report For example to run PyLint on a package/module called "control", do this -
pylint --files-output=y --reports=y control/

The Python equivalent should you wish to do the above is %SYNTAX{syntax="python"}% import pylint.lint pylint.lint.Run(('--files-output=y', '--reports=y', 'control')) %ENDSYNTAX%

If you're looking for codes to use to suppress some warnings, eg: pylint --disable-msg=c0322,c0323 then do pylint --list-msgs to see the full list.

Build Server

Windows Build Server

If you wish to add your code to the windows build server, for regular builds, please contact TerryRankine

Linux Build Server

Currently under development, however if you wish for your code to be built automaticly on the linux build server please contact TerryRankine

-- TerryRankine - 13 Oct 2006

Topic attachments
I Attachment Action Size Date Who Comment
pylint_and_depends.zipzip pylint_and_depends.zip manage 1348.2 K 09 Nov 2006 - 14:37 RyanFraser Pylint 0.12.1 and dependancies
Topic revision: r10 - 15 Oct 2010, UnknownUser
 

Current license: All material on this collaboration platform is licensed under a Creative Commons Attribution 3.0 Australia Licence (CC BY 3.0).