Open stonier opened 10 years ago
Eclipse - PyDev
Preferences->Pydev->Editors->Code Analysis
.So we can't get pydev running the same pep8 as roslint. However I haven't noticed any big difference except the default line length (pydev: 80, roslint: 120). I generally try and conform to that too these days, but you can always set --ignore=E501 in the eclipse settings and let roslint handle it on the command line.
@jihoonl, @bit-pirate, @dwlee, @hughie, @piyushk
This is carried over from Piyush's work initiated in the multimaster repo (https://github.com/robotics-in-concert/rocon_multimaster/issues/259). It's useful here as a reminder when creating new or updating old rocon python packages.
Roslint
All python packages in the rocon repositories should conform to pep8. To enable automated testing:
To automatically cut down a lot of errors:
You can also try the --aggresive for more aggresive correction. See
autopep8 --help
.Roslint Tips
# noqa
comment at the end of the line.This should in general be avoided and appears to be a contentious issue in the python world. The main argument against it is that it creates noise in the source file. I'm agnostic about it and care more just to get on with our work so do as you wish. One use case for it is in formatting a set of lines with extra whitespace for ease of reading (and hence arguably creating less noise in the source file despite the comment).