On Mon, Jun 06, 2022 at 07:57:12PM +0000, c.bu...@posteo.jp wrote:
> I want to invoke/use flake8 in my own python script and check the returning
> results.
> 
> I do something like this with pycodestyle which I use as a unittest. I would
> like to do this with flake8, too. On the list I found a posting from 2015
> about using flake8.main.main(). But it doesn't exist anymore.

You could always do a

    subprocess.run([sys.executable, "-m", "flake8", "src"],
                   cwd=pathlib.Path(__here__).parent, check=True)

or similar, but personally I prefer to add an extra [flake8] section to
my tox.ini.

Marius Gedminas
-- 
I am right now in the process of reading the Xft source code (the suspense near
the end of Chapter 7 is unbearable) [...]
        -- Juliusz Chroboczek

Attachment: signature.asc
Description: PGP signature

_______________________________________________
code-quality mailing list -- code-quality@python.org
To unsubscribe send an email to code-quality-le...@python.org
https://mail.python.org/mailman3/lists/code-quality.python.org/
Member address: arch...@mail-archive.com

Reply via email to