Strictly speaking, Prospector isn't an alternative to flake8, but to
PyLint. The verbosity of PyLint with default settings is the main
critique of Prospector's author. He's running a nice service, by the
way, Landscape. Very nice and free for Open Source projects.
https://landscape.io/

I'm using flake8 as a quality gateway for deployments (commits that
pass flake8 are deployed automatically), and Landscape (prospector) as
a measurement tool for code health.

Peter


2015-10-22 20:48 GMT+02:00 Linus Törngren <li...@etnolit.se>:
> Thank you for both for good solutions. At the moment I’m fine with flake8
> ending execution of my script.
>
> I was a bit stumped by the fact that my sys.argv variable is used by
> flake8.main(). After reading your answer I realized that I can easily modify
> sys.argv to simulate a cli call.
>
> Since asking the question I found an alternative called prospector. Anyone
> have any thoughts about that project? To me (quite the novice) it looks like
> a promising alternative.
>
>
>
> Linus Törngren
>
> 22 okt. 2015 kl. 17:04 skrev Ian Cordasco <graffatcolmin...@gmail.com>:
>
> On Thu, Oct 22, 2015 at 9:08 AM, Peter Bittner <peter.bitt...@gmx.net>
> wrote:
>
> Maybe like this?
>
> ```
> from flake8.main import main
>
> main()
> ```
>
>
> This is easily the most correct way of doing it.
>
> Notice that it's not exactly a public API and we do not return
> anything. You'll have to wrap it in
>
> ```
> from flake8 import main as flake8
>
> try:
>    flake8.main()
> except SystemExit:
>    # Whatever handling you want
> ```
>
> If you do not want flake8 to quit your script for you.
>
>
_______________________________________________
code-quality mailing list
code-quality@python.org
https://mail.python.org/mailman/listinfo/code-quality

Reply via email to