gabrielelanaro / emacs-for-python

Collection of emacs extensions specifically collected for python development, with workflow guidelines!
http://gabrielelanaro.github.com/emacs-for-python
GNU General Public License v3.0
810 stars 151 forks source link

Added a way to run multiple checkers. #130

Open mforbes opened 10 years ago

mforbes commented 10 years ago

From the documentation, it seems like one should be able to run multiple checkers with something like the following:

(epy-setup-checker "pyflakes %f; pep8 %f")

but because of the abstraction, this is passed to flymake as the command pyflakes with the rest as arguments (which fails). Ideally one would be able to add multiple commands with something like

(epy-add-checker "pyflakes %f")
(epy-add-checker "pep8 %f")

which would fail gracefully if one of the commands does not work, but still runs the others. Unfortunately I have been unable to grok the flymake documentation well enough to suggest a reasonable course of action here. Hoping this is an easy fix for you.

As a workaround, one can always define a custom script like and run this instead, but this is an ugly solution for deployment as it requires distribution and installation of this script:

#!/bin/bash
pyflakes $*
pep8 $*
gabrielelanaro commented 10 years ago

Unfortunately I wasn't able to circumvent the issue by running multiple statements as you mentioned.. As far as I remember flymake processes just one statement at a time.

mforbes commented 10 years ago

I also had difficulty getting things to work. My biggest issue now is to be able to use project-specific configurations for the various checkers. It seems your strategy of copying the files before checking breaks the search for configuration files in parent directories.

Have you considered using flycheck instead? It seems to solve both problems (have only used it for a little bit though, so I am not sure how stable it is yet. The issues with TRAMP will probably cause me problems later.)

gabrielelanaro commented 10 years ago

I'm not a huge fan of flymake, in fact I've patched it to add some features. flycheck looks really interesting I'll try it out and include it if it's a suitable replacement! Thank you so much for your feedback it's very useful. I'll keep you updated.

mforbes commented 10 years ago

Here is how I am presently using your project:

https://bitbucket.org/mforbes/mmfemacs

I use myrepos to pull in your project and then add a few customizations of my own. In particular, I use a common configuration file -- setup.cfg -- for pylint and and flake8 configuration. If a project defines these in the top level, then they automatically apply, otherwise the user's defaults apply.

However, I could not find a good way of disabling flymake without patching your code. I will open this as a separate issue: please suggest how I can do this better.

Thanks for pulling together these packages: it is very helpful to be able to just pull in a project like yours and get going!

(As an aside, the only things I have found I do not like are: 1) I often want to open a file from my home directory. I used to do this by c-x c-f then backspacing to clear the line, then starting with "~". This no longer works as backspacing leaves me at root "/" and I need to then get to my home directory from there somehow. Is there a simple solution? 2) The autoclosing parentheses and quotes are a bit of a pain since I often type the closing one, thus I end up with (1+1)) quite a bit. The best solution is that if a closing parenthesis etc. was automatically inserted, then inserting one at that point will simply move the point outside. I don't know where to go to configure this (or if it is possible).

Sorry for hijacking this issue. I can open these in a new request or put them on the wiki if you like. Just let me know and I will delete this.)