From 2e082bf2150788481ccc1fcf17822b722b406812 Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Fri, 17 May 2013 14:01:49 +0900 Subject: [PATCH] Add configuration file for PEP-8 checker tool The PEP-8 checker tool (pep8.py) [1, 2] is used to check that Python scripts follow the Style Guide for Python Code [3]. This change adds a configuration file for that tool. The configuration overrides the defaults for the following settings: To make it easier to see what's wrong, enable: - Quote the lines on which violations are found - Quote the relevant section of the PEP-8 guideline The maximum line length according to PEP-8 is 80 characters, but for some reason the checker defaults to 79, therefore: - Set maximum line length to 80 characters According to PEP-8, code should be indented at 4 characters, but the Google Python Style Guide [4] says 2. Code in Gerrit follows the Google style, so: - Disable warnings "Indentation is not a multiple of four" The configuration is invoked with the --config option when running the check tool: $ pep8.py --config ./contrib/.pep8rc myfile.py [1] https://github.com/jcrocholl/pep8 [2] https://pypi.python.org/pypi/pep8 [3] http://www.python.org/dev/peps/pep-0008/ [4] http://google-styleguide.googlecode.com/svn/trunk/pyguide.html Change-Id: If02dd9e51cf3a6e0c0238e78bcfad1d7081de742 --- contrib/.pep8rc | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 contrib/.pep8rc diff --git a/contrib/.pep8rc b/contrib/.pep8rc new file mode 100644 index 0000000000..568bcfba06 --- /dev/null +++ b/contrib/.pep8rc @@ -0,0 +1,5 @@ +[pep8] +max_line_length = 80 +show_pep8 = True +show_source = True +ignore = E111,E121