[wingide-users] PyLint on Save
Pete
pfein at pobox.com
Sat Aug 9 16:44:43 MDT 2008
On Aug 9, 2008, at 3:03 PM, Wingware Support wrote:
> Marcus.CM wrote:
>> I found some snippets of discussion on this. I would want Pylint to
>> be executed whenever a module is saved. This would iron out some
>> typos and undefined / name bugs
>> that so frequently occurs when renaming / changing lines of codes.
>> How can i do this, i am totally unfamiliar with the IDE extensions
>> scripting and i have tried things like "import pylintpanel" but it
>> cant find the module path :-)
>> Any direction?
>
> You would want to do something like the disabled example at the end
> of scripts/editor_extensions.py, although you would probably want to
> connect to the save-point signal instead of presave. You don't need
> to import pylintpanel, but instead would do this to kick off the
> update:
>
> wingapi.gApplication.ExecuteCommand('pylint-execute')
>
> See the manual to learn more about scripting Wing, and refer to the
> wingapi.py file in your Wing installation for the API.
I had an idea of using Pylint messages for the real-time warnings (the
yellow squiggly lines). PyLint seems to support a much larger set of
error, warning, etc. detection than Wing's internal engine. It'd be
neat to use PyLint to drive the highlighting. It's quite configurable
as well - I've found it easy to turn off the annoying warnings.
I catch potential mistakes even before writing unittests using
PyLint. On the whole, it's a nice complement to Wing's autocompletion
& nose for producing quality python code. Tighter integration in Wing
in any former would be a huge plus.
--Pete
More information about the wingide-users
mailing list