New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pylint throws lots of errors and warnings #2234
Comments
Launchpad user Juerg Haefliger(juergh) wrote on 2012-01-11T12:56:44.623514+00:00 The attached tarball contains a patch series that takes care of the pylint errors. |
Launchpad user Juerg Haefliger(juergh) wrote on 2012-01-12T09:45:55.365887+00:00 Above patchset fixes the following errors: ************* Module cloud-init-query |
Launchpad user Juerg Haefliger(juergh) wrote on 2012-01-12T09:53:44.749625+00:00 Attached patchset fixes the following pylint warnings. The patches get rid of a total of 281 warnings. Juerg Haefliger (13): cloud-init-cfg.py | 1 - Launchpad attachments: fix-pylint-warnings.tgz |
Launchpad user Juerg Haefliger(juergh) wrote on 2012-01-16T08:16:02.921107+00:00 Attached patchset fixed the following pylint convention violations. The patches fix a total of 450 violations. Juerg Haefliger (4): cloud-init-cfg.py | 22 ++-- Launchpad attachments: fix-pylint-conventions.tgz |
Launchpad user Juerg Haefliger(juergh) wrote on 2012-01-16T08:18:33.914292+00:00 Attached patch fixes the remaining PEP8 violations (http://www.python.org/dev/peps/pep-0008/'). Juerg Haefliger (1): cloud-init-cfg.py | 18 ++- Launchpad attachments: 0001-PEP8-coding-style-fixes.patch |
Launchpad user Juerg Haefliger(juergh) wrote on 2012-01-16T08:19:53.995910+00:00 Sorry, link to PEP8 in the previous comment is broken. Correct link is: http://www.python.org/dev/peps/pep-0008/ |
Launchpad user Juerg Haefliger(juergh) wrote on 2012-01-16T08:21:23.922835+00:00 With the attached patches, the code is now clean when checked as follows: #!/bin/bash files='cloud*.py cloudinit/.py cloudinit/CloudConfig/.py' cmd=(
) echo -e "\nRunning pylint:" cmd=(
) echo -e "\nRunning pep8:" |
Launchpad user Juerg Haefliger(juergh) wrote on 2012-01-16T09:48:25.223827+00:00 Final patch that adds HP to the copyright notice to please the legal department. Juerg Haefliger (1): cloud-init-cfg.py | 2 ++ Launchpad attachments: 0001-Fix-license-to-please-HP-legal.patch |
This bug was originally filed in Launchpad as LP: #914739
Launchpad details
Launchpad user Juerg Haefliger(juergh) wrote on 2012-01-11T12:53:56.261943+00:00
When running pylint against the cloud-init source, lots of errors and warnings are reported. Part of the full output is shown below. Some of them are bogus but some are serious and need to be addressed. I'll post a series of patches shortly that will take care of these errors/warnings.
No config file found, using default configuration
************* Module cloud-init-cfg
C0103: 1: Invalid name "cloud-init-cfg" (should match (([a-z_][a-z0-9_])|([A-Z][a-zA-Z0-9]+))$)
C0111: 1: Missing docstring
C0103: 28:Usage: Invalid name "Usage" (should match [a-z_][a-z0-9_]{2,30}$)
C0111: 28:Usage: Missing docstring
C0111: 31:main: Missing docstring
C0322: 53:main: Operator not preceded by a space
name=sys.argv[1]
^
C0322: 59:main: Operator not preceded by a space
run_args=sys.argv[3:]
^
C0103: 69:main: Invalid name "e" (should match [a-z_][a-z0-9_]{2,30}$)
C0324: 73:main: Comma not followed by a space
cc = CC.CloudConfig(cfg_path,cloud)
^^
C0103: 73:main: Invalid name "cc" (should match [a-z_][a-z0-9_]{2,30}$)
W0703: 78:main: Catch "Exception"
C0324: 76:main: Comma not followed by a space
(outfmt, errfmt) = CC.get_output_cfg(cc.cfg,modename)
^^
C0103: 78:main: Invalid name "e" (should match [a-z_][a-z0-9_]{2,30}$)
C0324: 88:main: Comma not followed by a space
module_list = CC.read_cc_modules(cc.cfg,modlist_cfg_name)
^^
C0324: 90:main: Comma not followed by a space
err("no modules to run in cloud_config [%s]" % modename,log)
^^
C0324: 95:main: Comma not followed by a space
failures = CC.run_cc_modules(cc,module_list,log)
^^
C0324: 97:main: Comma not followed by a space
err("errors running cloud_config [%s]: %s" % (modename,failures), log)
^^
R0912: 31:main: Too many branches (14/12)
R0915: 31:main: Too many statements (51/50)
C0324:100:err: Comma not followed by a space
def err(msg,log=None):
^^
C0111:100:err: Missing docstring
C0324:105:fail: Comma not followed by a space
def fail(msg,log=None):
^^
C0111:105:fail: Missing docstring
C0324:106:fail: Comma not followed by a space
err(msg,log)
^^
W0611: 26: Unused import traceback
************* Module cloud-init
W0311: 59: Bad indentation. Found 7 spaces, expected 8
W0311: 60: Bad indentation. Found 7 spaces, expected 8
W0311: 61: Bad indentation. Found 7 spaces, expected 8
W0311: 63: Bad indentation. Found 7 spaces, expected 8
W0311: 64: Bad indentation. Found 7 spaces, expected 8
C0103: 1: Invalid name "cloud-init" (should match (([a-z_][a-z0-9_])|([A-Z][a-zA-Z0-9]+))$)
C0111: 1: Missing docstring
C0111: 33:warn: Missing docstring
C0111: 36:main: Missing docstring
R0914: 36:main: Too many local variables (27/15)
C0324: 57:main: Comma not followed by a space
now = time.strftime("%a, %d %b %Y %H:%M:%S %z",time.gmtime())
^^
C0322: 59:main: Operator not preceded by a space
uptimef=open("/proc/uptime")
^
C0322: 60:main: Operator not preceded by a space
uptime=uptimef.read().split(" ")[0]
^
C0103: 62:main: Invalid name "e" (should match [a-z_][a-z0-9_]{2,30}$)
W0703: 68:main: Catch "Exception"
C0103: 68:main: Invalid name "e" (should match [a-z_][a-z0-9_]{2,30}$)
C0103: 72:main: Invalid name "e" (should match [a-z_][a-z0-9_]{2,30}$)
W0703: 79:main: Catch "Exception"
C0103: 79:main: Invalid name "e" (should match [a-z_][a-z0-9_]{2,30}$)
W0703: 87:main: Catch "Exception"
C0103: 87:main: Invalid name "e" (should match [a-z_][a-z0-9_]{2,30}$)
C0103: 99:main: Invalid name "f" (should match [a-z_][a-z0-9_]{2,30}$)
W0702:104:main: No exception type(s) specified
C0103:101:main: Invalid name "fp" (should match [a-z_][a-z0-9_]{2,30}$)
C0324:112:main: Comma not followed by a space
manclean = util.get_cfg_option_bool(cfg, 'manual_cache_clean',False)
^^
C0103:119:main: Invalid name "e" (should match [a-z_][a-z0-9_]{2,30}$)
C0321:120:main: More than one statement on a single line
C0103:132:main: Invalid name "e" (should match [a-z_][a-z0-9_]{2,30}$)
C0103:157:main: Invalid name "cc" (should match [a-z_][a-z0-9_]{2,30}$)
W0703:167:main: Catch "Exception"
C0324:165:main: Comma not followed by a space
warn("stdout, stderr changing to (%s,%s)" % (outfmt,errfmt))
^^
C0103:167:main: Invalid name "e" (should match [a-z_][a-z0-9_]{2,30}$)
C0324:176:main: Comma not followed by a space
if isinstance(cc_ready,str):
^^
C0324:184:main: Comma not followed by a space
failures = CC.run_cc_modules(cc,module_list,log)
^^
R0912: 36:main: Too many branches (24/12)
R0915: 36:main: Too many statements (111/50)
The text was updated successfully, but these errors were encountered: