[Python-projects] Pylint 1.12.1 no longer reads my .pylintrc file
Sylvain Thénault
sylvain.thenault at logilab.fr
Thu Sep 28 19:34:05 CEST 2006
On Thursday 28 September à 19:26, Marien Zwart wrote:
> On Thu, Sep 28, 2006 at 04:49:55PM +0200, Maarten ter Huurne wrote:
> > Marien Zwart wrote on 2006-09-27 01:52:06 AM:
> >
> > > I thought I hit the same thing, but it is just a somewhat obfuscated
> > > change, I think. The settings for
> > --{enable,disable}-{checker,msg-cat,msg}
> > > moved from the "MASTER" section to the "MESSAGES CONTROL" section.
> > > This is (somewhat) indicated in pylint --help. Unfortunately it looks
> > > like pylint --generate-rcfile omits options with no value set and
> > > entire sections if they have no options set, so it took me a while to
> > > figure this out.
> > >
> > > Not sure how that could be improved, but a way to generate a complete
> > > rcfile (even including unset and default settings) might be helpful
> > > (or is that already there and did I just miss it?)
> >
> > It is possible to solve this, but it would require significant changes to
> > PyLint:
> > - if the rcfile format changes, PyLint will have to include parser for the
> > old format and a parser for the new format
> > - the rcfile would have to include a version number at the start, so
> > PyLint knows which parser to use
> > - with "--generate-rcfile" the user can convert an old format rcfile to a
> > new format one
>
> While that would be nifty, I think some simpler changes would help too:
>
> - Have pylint warn (possibly only if a special option is passed, to help
> sharing a pylintrc between pylint versions) if an option in the pylintrc
> is not recognized (currently such options seem to be ignored).
> - Have an option to generate a complete rcfile, including options that are
> unset or set to their default value.
>
> While I do not know how others do this, my approach for generating an
> rcfile was doing "pylint --generate-rcfile > ~/.pylintrc" and then
> editing it. If default/unset values are omitted that does not work
> very well, and it was not obvious (not to me at least) that the
> "Messages control" header in --help meant I had to use a "[MESSAGES
> CONTROL]" section in .pylintrc. The above changes would make it all a
> bit more obvious, I think.
>
> If you agree this would help I could try to produce a patch.
I truly agree, while I'm not sure it would be easy to warn about unknown
option in the configuration file. But I guess changing the rc file generation
to include all options even if they're set to None or default value would
be pretty easy (hint: look at logilab.common.configuration ini_format_section
function ;)
--
Sylvain Thénault LOGILAB, Paris (France)
Formations Python, Zope, Plone, Debian: http://www.logilab.fr/formations
Développement logiciel sur mesure: http://www.logilab.fr/services
Python et calcul scientifique: http://www.logilab.fr/science
More information about the Python-Projects
mailing list