Discussion:
[Twisted-Python] Twisted formatting checking in Emacs?
Jonathan Lange
2015-06-12 08:57:33 UTC
Permalink
How can I set up Emacs so it gives me inline warnings of Twisted coding
standard violations?

I use flycheck <http://www.flycheck.org/> in Emacs for most projects, and
rely a lot on it. How can I configure it to use twistedchecker
<https://github.com/twisted/twistedchecker> for syntax checks for Twisted
instead of its default flake8 & pylint checkers?

Thanks,
jml
Jonathan Lange
2015-06-12 09:21:27 UTC
Permalink
Post by Jonathan Lange
How can I set up Emacs so it gives me inline warnings of Twisted coding
standard violations?
I use flycheck <http://www.flycheck.org/> in Emacs for most projects, and
rely a lot on it. How can I configure it to use twistedchecker
<https://github.com/twisted/twistedchecker> for syntax checks for Twisted
instead of its default flake8 & pylint checkers?
I have also posted this question to Stack Exchange
<http://emacs.stackexchange.com/questions/13109/how-can-i-use-a-custom-python-linter-for-a-specific-project-with-flycheck>
.
Glyph Lefkowitz
2015-06-12 20:05:44 UTC
Permalink
How can I set up Emacs so it gives me inline warnings of Twisted coding standard violations?
I use flycheck <http://www.flycheck.org/> in Emacs for most projects, and rely a lot on it. How can I configure it to use twistedchecker <https://github.com/twisted/twistedchecker> for syntax checks for Twisted instead of its default flake8 & pylint checkers?
I have also posted this question to Stack Exchange <http://emacs.stackexchange.com/questions/13109/how-can-i-use-a-custom-python-linter-for-a-specific-project-with-flycheck>.
If you sort this out nicely, please share :). One problem I've had with setting up automatic flymake checking in Twisted is that I cannot figure out how to get it to show me deltas from trunk. Branches with gigantic unrelated cleanups in them are hard to review, and I don't want my editor yelling at me about changes that aren't in my additions or changes. (Except when I'm working on a branch whose _goal_ is cleanups, in which case I do).

However, buildbot does this somehow, so it must be possible :).

-glyph
Jonathan Lange
2015-06-13 08:43:41 UTC
Permalink
Post by Jonathan Lange
Post by Jonathan Lange
How can I set up Emacs so it gives me inline warnings of Twisted coding
standard violations?
I use flycheck <http://www.flycheck.org/> in Emacs for most projects,
and rely a lot on it. How can I configure it to use twistedchecker
<https://github.com/twisted/twistedchecker> for syntax checks for
Twisted instead of its default flake8 & pylint checkers?
I have also posted this question to Stack Exchange
<http://emacs.stackexchange.com/questions/13109/how-can-i-use-a-custom-python-linter-for-a-specific-project-with-flycheck>
.
If you sort this out nicely, please share :). One problem I've had with
setting up automatic flymake checking in Twisted is that I cannot figure
out how to get it to show me deltas from trunk. Branches with gigantic
unrelated cleanups in them are hard to review, and I don't want my editor
yelling at me about changes that aren't in my additions or changes.
(Except when I'm working on a branch whose _goal_ is cleanups, in which
case I do).
However, buildbot does this somehow, so it must be possible :).
If I were to try to solve that particular problem, here's what I'd do:

- add a thing to the checker to allow you to provide a file of known,
suppressed warnings; the checker would also warn if expected warnings
weren't there
- add a Python unit test that fails if there are warnings issued that
aren't known, or "known" warnings that have gone away
- kill the dedicated twistedchecker builder
- whenever I fix up warnings, also modify that file
- any lint warnings that I wished to legitimately suppress (not just to
enable incremental migration) I'd disable with comments in the file

Before I did that, I'd make sure the version of twistedchecker was pinned,
because new versions are likely to add/remove warnings. I'd also probably
have a round of massively relaxing twistedchecker's rules.

jml

Loading...