First time here? Check out the FAQ!
1

use additional code checkers?

Is there a way to use code checkers besides pylint, pep8 and mypy?

I'm asking because I would like to start playing around with type hints as a start to migrating my python2 stuff to python3. I can't use mypy because it requires python3 (and then complains that all my libraries don't exist). I'm examining other type checkers (pytype), but can't seem to figure a way to integrate them into Wing.

Chris Curvey's avatar
216
Chris Curvey
asked 2019-10-05 05:48:05 -0500
Wingware Support's avatar
4k
Wingware Support
updated 2019-10-05 10:12:19 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

0

There isn't a way to integrate another external checker into Wing right now other than getting the sources for Wing (which you can do under nondisclosure agreement) and adding the feature. Each checker requires custom code in various places and there's not yet a plugin interface.

You could of course just invoke a checker in the OS Commands tool, but it won't be a tight integration as is available for pylint, etc.

Another idea is to look at script/pylintpanel.py in your Wing installation and copy and adapt it. That is the old pylint integration from Wing 6 and earlier. It's disabled in Wing 7 but could be enabled and would give you a new panel in Wing's interface that contains the list of warnings found by your added type checker.

Incidentally, 2to3 helps a bit with the conversion for some things, particularly changing print to print() and things like y.has_key(x) to x in y (and with experience you can configure it to disable harmful or broken conversions). But it likely won't help with string encodings and the conversion from the Python 2 to 3 model for str/unicode -> bytes/str; also not for conversion of extension modules. In any case, best to convert to latest Python 2.7 and remove as much Python 2 specific stuff as you can before then introducing incompatible Python 3 changes. We have a fair amount of code that actually runs under both Python 2 and Python 3 w/o changes, but that's maybe only a good idea if you do need to maintain for Python 2 and not otherwise (it's doable but more work).

Wingware Support's avatar
4k
Wingware Support
answered 2019-10-05 10:11:51 -0500
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss.

Add Answer