<html><head></head><body><div style="color:#000; background-color:#fff; font-family:Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:13px"><div id="yui_3_16_0_ym19_1_1492623561984_11506" dir="ltr">Hello,<br id="yui_3_16_0_ym19_1_1492623561984_11656"><br id="yui_3_16_0_ym19_1_1492623561984_11657">I'm trying to set up my build system to use pylintrc files during the build. <br id="yui_3_16_0_ym19_1_1492623561984_11658">For example, in my pylintrc file I was going to do something like:<br id="yui_3_16_0_ym19_1_1492623561984_11659"><br id="yui_3_16_0_ym19_1_1492623561984_11660">```<br id="yui_3_16_0_ym19_1_1492623561984_11661">disable=all <br id="yui_3_16_0_ym19_1_1492623561984_11662">enable=E <br id="yui_3_16_0_ym19_1_1492623561984_11663">disable=import-error<br id="yui_3_16_0_ym19_1_1492623561984_11664">```<br id="yui_3_16_0_ym19_1_1492623561984_11665"><br id="yui_3_16_0_ym19_1_1492623561984_11666">Which (of course) doesn't work:<br id="yui_3_16_0_ym19_1_1492623561984_11667"><br id="yui_3_16_0_ym19_1_1492623561984_11668">```<br id="yui_3_16_0_ym19_1_1492623561984_11669">$>pylint --rcfile=pylintrc my_file.py<br id="yui_3_16_0_ym19_1_1492623561984_11670"> <stacktrace truncated><br id="yui_3_16_0_ym19_1_1492623561984_11671"> backports.configparser.DuplicateOptionError: While reading from 'pylintrc' [line 24]: option u'disable' in section u'MESSAGES CONTROL' already exists<br id="yui_3_16_0_ym19_1_1492623561984_11672">```<br id="yui_3_16_0_ym19_1_1492623561984_11673"><br id="yui_3_16_0_ym19_1_1492623561984_11674">Once I realised that they are INI files, it made more sense. INI files do not allow for multiple values for a key (within a section), and different parsers handle this case differently.<br id="yui_3_16_0_ym19_1_1492623561984_11675">Since strict=True was being used by the Python parser, it raise this exception.<br id="yui_3_16_0_ym19_1_1492623561984_11676"><br id="yui_3_16_0_ym19_1_1492623561984_11677">The annoying part is that you can pass multiple 'enable/disable' arguments on the command line.<br id="yui_3_16_0_ym19_1_1492623561984_11678">In fact, there is an example in the documentation auto-generated by `pylint --generate-rcfile`: <br id="yui_3_16_0_ym19_1_1492623561984_11679"><br id="yui_3_16_0_ym19_1_1492623561984_11680"> "If you want to run only the classes checker, but have no Warning level messages displayed, use '--disable=all --enable=classes --disable=W'"<br id="yui_3_16_0_ym19_1_1492623561984_11681"> <br id="yui_3_16_0_ym19_1_1492623561984_11682">But this cannot be done in the pylintrc file. Annoying, since I was not going to use the command line and changing my build system to do would be non-trivial.<br id="yui_3_16_0_ym19_1_1492623561984_11683"><br id="yui_3_16_0_ym19_1_1492623561984_11684">I would like to see the pylintrc file have at least as much capability as the command line. I would like to propose to extend the syntax to provide an ordering.<br id="yui_3_16_0_ym19_1_1492623561984_11685"><br id="yui_3_16_0_ym19_1_1492623561984_11686">Proposal:<br id="yui_3_16_0_ym19_1_1492623561984_11687"><br id="yui_3_16_0_ym19_1_1492623561984_11688">Today we have "disable" and "enable", with "enable" taking precedent.<br id="yui_3_16_0_ym19_1_1492623561984_11689">Perhaps we could change the syntax to be "disableX" "enableY", with X and Y being positive integers. Higher precedence would be determined by higher integers. "enable" would still have precedent within a given integer level.<br id="yui_3_16_0_ym19_1_1492623561984_11690"><br id="yui_3_16_0_ym19_1_1492623561984_11691">It would be backwards compatible, with 'disable' being an alias for 'disable1' and 'enable' being an alias for 'enable1'.<br id="yui_3_16_0_ym19_1_1492623561984_11692"><br id="yui_3_16_0_ym19_1_1492623561984_11693">Some examples:<br id="yui_3_16_0_ym19_1_1492623561984_11694"><br id="yui_3_16_0_ym19_1_1492623561984_11695">```<br id="yui_3_16_0_ym19_1_1492623561984_11696">disable=all<br id="yui_3_16_0_ym19_1_1492623561984_11697">enable=classes<br id="yui_3_16_0_ym19_1_1492623561984_11698">disable2=W<br id="yui_3_16_0_ym19_1_1492623561984_11699">```<br id="yui_3_16_0_ym19_1_1492623561984_11700"><br id="yui_3_16_0_ym19_1_1492623561984_11701">would be equivalent to:<br id="yui_3_16_0_ym19_1_1492623561984_11702"><br id="yui_3_16_0_ym19_1_1492623561984_11703">```<br id="yui_3_16_0_ym19_1_1492623561984_11704">disable1=all<br id="yui_3_16_0_ym19_1_1492623561984_11705">enable1=classes<br id="yui_3_16_0_ym19_1_1492623561984_11706">disable2=W<br id="yui_3_16_0_ym19_1_1492623561984_11707">```<br id="yui_3_16_0_ym19_1_1492623561984_11708"><br id="yui_3_16_0_ym19_1_1492623561984_11709">There could easily be a better way to do that this, or some pattern/syntax people already use when dealing with INI files in order to work around this.<br id="yui_3_16_0_ym19_1_1492623561984_11710">I would like to see the pylintrc file have at least as much capability as the command line.<br id="yui_3_16_0_ym19_1_1492623561984_11711"><br id="yui_3_16_0_ym19_1_1492623561984_11712">Let me know what you think,<br id="yui_3_16_0_ym19_1_1492623561984_11713"><br id="yui_3_16_0_ym19_1_1492623561984_11714">Michael Overmeyer<br id="yui_3_16_0_ym19_1_1492623561984_11715"><br></div></div></body></html>