[chirp_devel] [PATCH 4/7] Add pep8 checker script (#2355)

Dan Smith
Thu Feb 26 16:41:04 PST 2015


> # HG changeset patch
> # User Zach Welch <zach at mandolincreekfarm.com>
> 
> Add pep8 checker script (#2355)

When I apply this and run it thusly:

 TESTS=pep8 ./run_all_tests.sh

I get this:

> ./chirpc

... snip like a hundred lines ...

> ./chirpc
> ./chirpc
> ./chirpc
> ./chirpc
> ./chirpc
> 194     E101 indentation contains mixed spaces and tabs
> 6       E221 multiple spaces before operator
> 5       E302 expected 2 blank lines, found 1
> 1       E501 line too long (80 characters)
> 194     W191 indentation contains tabs
> 2       W293 blank line contains whitespace
> 1       W391 blank line at end of file
> ================================================
> Tests FAILED: pep8, driver tests

Didn't look to see why.

> diff --git a/tools/pep8.py b/tools/pep8.py
> new file mode 100755
> index 0000000..efbfd14
> --- /dev/null
> +++ b/tools/pep8.py
> @@ -0,0 +1,75 @@
> +#!/usr/bin/env python
> +#
> +#  pep8.py - Check Python source files for PEP8 compliance.

So, I think this should import and use pep8 as a library instead of
running the command line, as is common practice. You can customize it
extensively that way and it's a little more integrated. See this for
starters:

http://pep8.readthedocs.org/en/latest/advanced.html

...but there are some good examples elsewhere. Should be able to do
everything you need that way.

--Dan

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
Url : http://intrepid.danplanet.com/pipermail/chirp_devel/attachments/20150226/45dbbd9d/attachment-0001.bin 


More information about the chirp_devel mailing list