I am an absolute Pylint newbie, and I can't pylint to work at all. I am using
python3.3 on a RHEL5.8 box.
I am trying to Pylint a django project and honestly don't know how to begin. I
am pretty sure I need a .pylintrc file but how do I specify in
Init-hook to get the django environment settings, pathing etc set up so it is
like running manage.py.
If I run without a config file I get the traceback below.
Thanks,
Danny
[root@localhost /opt/www/arat]# pylint src/apps/mapping/views.py
No config file found, using default configuration
Traceback (most recent call last):
File
"/opt/python3.3.1/lib/python3.3/site-packages/logilab_astng-0.24.3-py3.3.egg/logilab/astng/manager.py",
line 161, in file_from_module_name
value = self._mod_file_cache[(modname, contextfile)]
KeyError: ('django.contrib.gis.db.models', None)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File
"/opt/python3.3.1/lib/python3.3/site-packages/pylint-0.28.0-py3.3.egg/pylint/lint.py",
line 638, in get_astng
return MANAGER.astng_from_file(filepath, modname, source=True)
File
"/opt/python3.3.1/lib/python3.3/site-packages/logilab_astng-0.24.3-py3.3.egg/logilab/astng/manager.py",
line 104, in astng_from_file
return ASTNGBuilder(self).file_build(filepath, modname)
File
"/opt/python3.3.1/lib/python3.3/site-packages/logilab_astng-0.24.3-py3.3.egg/logilab/astng/builder.py",
line 128, in file_build
node = self.string_build(data, modname, path)
File
"/opt/python3.3.1/lib/python3.3/site-packages/logilab_astng-0.24.3-py3.3.egg/logilab/astng/builder.py",
line 141, in string_build
self.delayed_assattr(delayed)
File
"/opt/python3.3.1/lib/python3.3/site-packages/logilab_astng-0.24.3-py3.3.egg/logilab/astng/builder.py",
line 194, in delayed_assattr
for infered in node.expr.infer():
File
"/opt/python3.3.1/lib/python3.3/site-packages/logilab_astng-0.24.3-py3.3.egg/logilab/astng/bases.py",
line 307, in wrapped
for res in _func(node, context, **kwargs):
File
"/opt/python3.3.1/lib/python3.3/site-packages/logilab_astng-0.24.3-py3.3.egg/logilab/astng/bases.py",
line 115, in _infer_stmts
for infered in stmt.infer(context):
File
"/opt/python3.3.1/lib/python3.3/site-packages/logilab_astng-0.24.3-py3.3.egg/logilab/astng/bases.py",
line 307, in wrapped
for res in _func(node, context, **kwargs):
File
"/opt/python3.3.1/lib/python3.3/site-packages/logilab_astng-0.24.3-py3.3.egg/logilab/astng/bases.py",
line 115, in _infer_stmts
for infered in stmt.infer(context):
File
"/opt/python3.3.1/lib/python3.3/site-packages/logilab_astng-0.24.3-py3.3.egg/logilab/astng/bases.py",
line 307, in wrapped
for res in _func(node, context, **kwargs):
File
"/opt/python3.3.1/lib/python3.3/site-packages/logilab_astng-0.24.3-py3.3.egg/logilab/astng/bases.py",
line 331, in wrapper
for node in func(*args, **kwargs):
File
"/opt/python3.3.1/lib/python3.3/site-packages/logilab_astng-0.24.3-py3.3.egg/logilab/astng/inference.py",
line 156, in infer_callfunc
for callee in self.func.infer(context):
File
"/opt/python3.3.1/lib/python3.3/site-packages/logilab_astng-0.24.3-py3.3.egg/logilab/astng/bases.py",
line 307, in wrapped
for res in _func(node, context, **kwargs):
File
"/opt/python3.3.1/lib/python3.3/site-packages/logilab_astng-0.24.3-py3.3.egg/logilab/astng/bases.py",
line 331, in wrapper
for node in func(*args, **kwargs):
File
"/opt/python3.3.1/lib/python3.3/site-packages/logilab_astng-0.24.3-py3.3.egg/logilab/astng/inference.py",
line 208, in infer_getattr
for owner in self.expr.infer(context):
File
"/opt/python3.3.1/lib/python3.3/site-packages/logilab_astng-0.24.3-py3.3.egg/logilab/astng/bases.py",
line 307, in wrapped
for res in _func(node, context, **kwargs):
File
"/opt/python3.3.1/lib/python3.3/site-packages/logilab_astng-0.24.3-py3.3.egg/logilab/astng/bases.py",
line 331, in wrapper
for node in func(*args, **kwargs):
File
"/opt/python3.3.1/lib/python3.3/site-packages/logilab_astng-0.24.3-py3.3.egg/logilab/astng/inference.py",
line 208, in infer_getattr
for owner in self.expr.infer(context):
File
"/opt/python3.3.1/lib/python3.3/site-packages/logilab_astng-0.24.3-py3.3.egg/logilab/astng/bases.py",
line 307, in wrapped
for res in _func(node, context, **kwargs):
File
"/opt/python3.3.1/lib/python3.3/site-packages/logilab_astng-0.24.3-py3.3.egg/logilab/astng/bases.py",
line 115, in _infer_stmts
for infered in stmt.infer(context):
File
"/opt/python3.3.1/lib/python3.3/site-packages/logilab_astng-0.24.3-py3.3.egg/logilab/astng/bases.py",
line 307, in wrapped
for res in _func(node, context, **kwargs):
File
"/opt/python3.3.1/lib/python3.3/site-packages/logilab_astng-0.24.3-py3.3.egg/logilab/astng/inference.py",
line 195, in infer_from
module = self.do_import_module(self.modname)
File
"/opt/python3.3.1/lib/python3.3/site-packages/logilab_astng-0.24.3-py3.3.egg/logilab/astng/mixins.py",
line 103, in do_import_module
return mymodule.import_module(modname, level=level)
File
"/opt/python3.3.1/lib/python3.3/site-packages/logilab_astng-0.24.3-py3.3.egg/logilab/astng/scoped_nodes.py",
line 339, in import_module
return MANAGER.astng_from_module_name(absmodname)
File
"/opt/python3.3.1/lib/python3.3/site-packages/logilab_astng-0.24.3-py3.3.egg/logilab/astng/manager.py",
line 133, in astng_from_module_name
return self.astng_from_file(filepath, modname, fallback=False)
File
"/opt/python3.3.1/lib/python3.3/site-packages/logilab_astng-0.24.3-py3.3.egg/logilab/astng/manager.py",
line 104, in astng_from_file
return ASTNGBuilder(self).file_build(filepath, modname)
File
"/opt/python3.3.1/lib/python3.3/site-packages/logilab_astng-0.24.3-py3.3.egg/logilab/astng/builder.py",
line 128, in file_build
node = self.string_build(data, modname, path)
File
"/opt/python3.3.1/lib/python3.3/site-packages/logilab_astng-0.24.3-py3.3.egg/logilab/astng/builder.py",
line 138, in string_build
self.add_from_names_to_locals(from_node)
File
"/opt/python3.3.1/lib/python3.3/site-packages/logilab_astng-0.24.3-py3.3.egg/logilab/astng/builder.py",
line 178, in add_from_names_to_locals
imported = node.root().import_module(node.modname)
File
"/opt/python3.3.1/lib/python3.3/site-packages/logilab_astng-0.24.3-py3.3.egg/logilab/astng/scoped_nodes.py",
line 339, in import_module
return MANAGER.astng_from_module_name(absmodname)
File
"/opt/python3.3.1/lib/python3.3/site-packages/logilab_astng-0.24.3-py3.3.egg/logilab/astng/manager.py",
line 121, in astng_from_module_name
filepath = self.file_from_module_name(modname, context_file)
File
"/opt/python3.3.1/lib/python3.3/site-packages/logilab_astng-0.24.3-py3.3.egg/logilab/astng/manager.py",
line 165, in file_from_module_name
context_file=contextfile)
File
"/opt/python3.3.1/lib/python3.3/site-packages/logilab_common-0.59.1-py3.3.egg/logilab/common/modutils.py",
line 295, in file_from_modpath
return _file_from_modpath(modpath, path, context)
File
"/opt/python3.3.1/lib/python3.3/site-packages/logilab_common-0.59.1-py3.3.egg/logilab/common/modutils.py",
line 554, in _file_from_modpath
mtype, mp_filename = _module_file(modpath, path)
File
"/opt/python3.3.1/lib/python3.3/site-packages/logilab_common-0.59.1-py3.3.egg/logilab/common/modutils.py",
line 620, in _module_file
emtype, emp_filename, zippath = _search_zip(modpath, pic)
File
"/opt/python3.3.1/lib/python3.3/site-packages/logilab_common-0.59.1-py3.3.egg/logilab/common/modutils.py",
line 573, in _search_zip
'.'.join(modpath[1:]), file, modpath))
NameError: global name 'file' is not defined
************* Module mapping.views
F: 1,0: <class 'NameError'>: global name 'file' is not defined
[root@localhost /opt/www/arat]#
_______________________________________________
Python-Projects mailing list
[email protected]
http://lists.logilab.org/mailman/listinfo/python-projects