From: Josip <jo...@pi...> - 2014-05-08 21:25:30
|
Dana 8.5.2014. 20:05, Jerome je napisao: > Devs, > > I ran pylint 0.25 on current gramps40 git revision! > > My listed Errors are on: > bug #7678 > > Patch (31.4 ko) available on the bug report. > > Only few fixes, most new lines are comments with details about the > "possible" error. > > It is not a standard 'audit', but I think that some errors are important. > > eg, > --- a/gramps/cli/clidbman.py > +++ b/gramps/cli/clidbman.py > @@ -350,6 +350,10 @@ class CLIDbManager(object): > # write locally: > temp_fp.write(data) > url_fp.close() > + > + # CLIDbManager.import_new_db: Using variable 'name' before assignment > + # CLIDbManager.import_new_db: Using variable 'dbase' before assignment > + > from gen.db.dbconst import BDBVERSFN > versionpath = os.path.join(name, BDBVERSFN) > _LOG.debug("Write bsddb version %s" % > str(dbase.version())) > > diff --git a/gramps/grampsapp.py b/gramps/grampsapp.py > index 1bdc699..1e6a9cc 100644 > --- a/gramps/grampsapp.py > +++ b/gramps/grampsapp.py > @@ -35,6 +35,9 @@ import sys > ## hack to avoid mentioning 'utf8' encoding everywhere unicode or str > is is used > if sys.version_info[0] < 3: > reload(sys) > + > + # Module 'sys' has no 'setdefaultencoding' member > + > sys.setdefaultencoding('utf8') > ## > import os > > Every return for GUI stuff could be considered as "unsafe", because I > was not able to properly set gi.repository within the global script for > running pylint... > > Anyway, as an error is not a warning, something might be incomplete, but > I was not able to quickly fix them. > > Maybe a review could be welcome? > > > regards, > Jérôme > How to run pylint on Gramps? I see "gramps/*/*/*.py" on bug report, should i use that. With "pylint gramps/*/*/*.py" i get score 3.85/10 but don't see errors you mentioned in bugs report. $ pylint --version pylint 1.2.1, astroid 1.1.1, common 0.61.0 Python 2.7.6 (default, Apr 29 2014, 07:48:08) [GCC 4.9.0] No config file found, using default configuration Tested on Windows with gramps-4.0.4-5230f89 p.s. You can set environment variable GI_TYPELIB_PATH to handle custom gi repository. -- Josip |