Hi, Attached is a diff of a few documentation improvements that we've been working on. Our changes fell under three main areas:
- Expanding and reformatting the FAQ: We found the FAQ extremely difficult to read and navigate, so we reformatted it with the questions as subheadings (this is one of the methods recommended by Docutils, and the method they use in their own FAQ: http://docutils.sourceforge.net/FAQ.html#how-can-i-mark-up-a-faq-or-other-list-of-questions-answers). In addition, we added some new questions and answers, reflecting our own experience with the code, as well as some general information we thought that users might find useful. There is some duplication of information between the FAQ and the manual, which was not unintentional; however, if you don't think this is desirable, we could try to keep the information in the two documents distinct. One disadvantage we ran into with the reformatting is that, in order to keep the titles on one line (which, as far as we can tell, is necessary), we had to have a few lines that were longer than 80 characters. In as many cases as possible, we tried to reword the questions into more succinct forms, so this only happens a couple times. - Copy editing: We tried to fix some occasional odd wording, or typos. - A table of command line options: with the mass of command line options and features that pylint offers, a new user the command page that we have added when built into the html file will display a table of all of pylints command line options, the arguments they take, and a description of what they are used for. A few options have shortcuts which are also displayed in the table. If you can think of any way that we could improve any of these, we're very open to suggestions. Thanks, -- Team Tahiti
diff -r 16f098a0c3ae doc/FAQ.txt --- a/doc/FAQ.txt Tue Mar 30 14:54:42 2010 +0200 +++ b/doc/FAQ.txt Thu Apr 01 03:51:15 2010 -0400 @@ -1,186 +1,327 @@ +========================== Frequently Asked Questions ========================== +.. contents:: -Question: - Is it possible to give file as argument to pylint, instead of module ? +1. About Pylint +=============== -Answer: - pylint expects the name of a package or module as argument. As a convenience, - you can give to it a file name if it's possible to guess a module name from - the file's path, using the python path. Some examples : +1.1 What is Pylint? +-------------------- - "pylint mymodule.py" should always works since the current working - directory is automatically added on top of the python path +Pylint is a `static code checker`_, meaning it can analyse your code without +actually running it. Pylint checks for errors, tries to enforce a coding +standard, and tries to enforce a coding style. - "pylint directory/mymodule.py" will work if "directory" is a python - package (i.e. has an __init__.py file) or if "directory" is in the - python path. +.. _`static code checker`: http://en.wikipedia.org/wiki/Static_code_analysis - "pylint /whatever/directory/mymodule.py" will work if either: +1.2 How is Pylint different from Pychecker? +------------------------------------------- - - "/whatever/directory" is in the python path +A major difference between Pylint and Pychecker_ is that Pylint checks for +style issues, while Pychecker explicitly does not. There are a few other +differences, such as the fact that Pylint does not import live modules while +Pychecker does (see `6.2 Why does Pychecker catch problems with imports that +Pylint doesn't?`_). - - your cwd is "/whatever/directory" +1.3 Who wrote Pylint? +--------------------- - - "directory" is a python package and "/whatever" is in the python - path +Pylint's main author and maintainer is Sylvain Thénault. For a full list of +contributors, see the "Contributors" section of Pylint's README file. - - "directory" is a python package and your cwd is "/whatever" - and so on... +1.4 Who uses Pylint? +-------------------- +In addition to many individuals, the following projects are known to use pylint +to help develop better +code: +* OSAF Chandler (http://www.osafoundation.org/) +* Xen (http://www.xensource.com/) +* CPS (http://www.nuxeo.org) +* ERP5 (http://www.erp5.org/) +* pyxmpp (http://pyxmpp.jabberstudio.org/) +* mercurial +* eXe (http://exelearning.org/) +* PrimaGIS (http://www.primagis.org) +* python-cdd (http://projetos.ossystems.com.br/python-cdd/) +* CDSWare (http://cdsware.cern.ch/) +* ASE (http://dcwww.camp.dtu.dk/campos/ASE/intro.html) +* RunJob (http://projects.fnal.gov/runjob/) +* Slugathon (http://slugathon.python-hosting.com/) +* Topographica (http://topographica.org/Home/index.html) (at least + they intend to do so) +* http://browsershots.org -Question: - I'm using psyobj from psyco_ and get a lot of spurious "unused variables - messages". Is it normal ? -Answer: - Yes. That's actually due to a bug in psyco, making the locals() - function for objects inheriting from *psyobj* returning an empty - dictionary. For the moment, the only way to fix this is to use the - PYLINT_IMPORT environment variable to not use psyco during pylint - checking. Sample code :: +2. Installation +=============== - import os - try: - if os.environ.has_key('PYLINT_IMPORT'): - raise ImportError() +2.1 How do I install Pylint? +---------------------------- + +The easiest way to install Pylint, if you have the setuptools_ package, is to +invoke :: + + easy_install pylint + +Otherwise, you'll have to download the source for Pylint and its dependencies +from the Logilab site, or through Pylint's repository. See the user manual for +detailed installation instructions. + +.. _setuptools: http://pypi.python.org/pypi/setuptools + +2.2 What kind of versioning system does Pylint use? +--------------------------------------------------- + +Pylint uses the Mercurial_ distributed version control system. The URL of the +repository is: http://www.logilab.org/hg/pylint. To get the latest version of +Pylint from the repository, simply invoke :: + + hg clone http://www.logilab.org/hg/pylint + +.. _Mercurial: http://mercurial.selenic.com/ + +2.3 What are Pylint's dependencies? +----------------------------------- + +Pylint requires the latest `logilab-astng`_ and `logilab-common`_ +packages. It should be compatible with any python version greater than +2.2.0 (python 2.2 users will have to install the optik_ package). + +.. _`logilab-astng`: http://www.logilab.org/project/name/astng +.. _`logilab-common`: http://www.logilab.org/project/name/common +.. _optik: http://optik.sourceforge.net/ + + +3. Running Pylint +================= + +3.1 Can I give pylint a file as an argument instead of a module? +----------------------------------------------------------------- + +Pylint expects the name of a package or module as its argument. As a +convenience, +you can give it a file name if it's possible to guess a module name from +the file's path using the python path. Some examples : + +"pylint mymodule.py" should always work since the current working +directory is automatically added on top of the python path + +"pylint directory/mymodule.py" will work if "directory" is a python +package (i.e. has an __init__.py file) or if "directory" is in the +python path. + +"pylint /whatever/directory/mymodule.py" will work if either: + + - "/whatever/directory" is in the python path + + - your cwd is "/whatever/directory" + + - "directory" is a python package and "/whatever" is in the python + path + + - "directory" is a python package and your cwd is "/whatever" and so + on... + +3.2 Where is the persistent data stored to compare between successive runs? +---------------------------------------------------------------------------- + +Analysis data are stored as a pickle file in a directory which is +localized using the following rules: + +* value of the PYLINTHOME environment variable if set + +* ".pylint.d" subdirectory of the user's home directory if it is found + (not always findable on Windows platforms) + +* ".pylint.d" directory in the current directory + +3.3 How do I find the option name (for pylintrc) corresponding to a specific command line option? +-------------------------------------------------------------------------------------------------------- + +You can always generate a sample pylintrc file with --generate-rcfile +Every option present on the command line before this will be included in +the rc file + +For example:: + + pylint --disable-msg=W0702,C0103 --class-rgx='[A-Z][a-z]+' --generate-rcfile + +3.4 I'd rather not run Pylint from the command line. Can I integrate it with my editor? +--------------------------------------------------------------------------------------- + +Yes! Pylint can be integrated with many popular editors and IDEs. The following +include Pylint by default: + +* emacs (of course) +* eric3 +* eclipse (using the pydev_ plugin, see also + http://msdl.cs.mcgill.ca/MSDL/people/denis/meetings/pythonDev) + +To use pylint from within vim, see +http://www.gonzo.kiev.ua/projects/pylint.vim + +To use pylint from within komodo_, see +http://mateusz.loskot.net/2006/01/15/running-pylint-from-komodo/ + +To use pylint from within gedit_, see +http://live.gnome.org/Gedit/PylintPlugin + +To use pylint from within WingIDE_, see +http://www.wingware.com/doc/edit/pylint + +.. _pydev: http://pydev.sourceforge.net +.. _komodo: http://www.activestate.com/Products/Komodo/ +.. _gedit: http://www.gnome.org/projects/gedit/ +.. _WingIDE: http://www.wingware.com/ + +4. Message Control +================== + +4.1 Is it possible to locally disable a particular message? +----------------------------------------------------------- + +Yes, this feature has been added in pylint 0.11. This may be done by +adding "#pylint: disable-msg=W0123,E4567" at the desired block level +or at the end of the desired line of code + + +4.2 Why do I get a lot of spurious "unused variables messages" when using psyobj from psyco_? +---------------------------------------------------------------------------------------------- + +This is actually due to a bug in psyco, making the locals() +function for objects inheriting from *psyobj* returning an empty +dictionary. For the moment, the only way to fix this is to use the +PYLINT_IMPORT environment variable to not use psyco during pylint +checking. Sample code :: + + import os + try: + if os.environ.has_key('PYLINT_IMPORT'): + raise ImportError() from psyco.classes import psyobj - except ImportError: - class psyobj: - pass + except ImportError: + class psyobj: + pass - NOTICE: this problem should not occurs with pylint >= 0.5 since from - this version pylint is not looking anymore for information in living - objects (i.e. it doesn't anymore import analysed modules) - - - -Question: - I've a function / method which is a callback where I do not have any - control on received argument, and pylint is complaining about unused - arguments. What can I do to avoid those warnings ? - -Answer: - prefix (ui) the callback's name by `cb_`, as in cb_onclick(...). By - doing so arguments usage won't be checked. Another solution is to - use one of the name defined in the "dummy-variables" configuration - variable for unused argument ("_" and "dummy" by default). - - - -Question: - When is pylint considering a class as an interface ? - -Answer: - A class is considered as an interface if there is a class named - "Interface" somewhere in it ancestor's tree. - - - -Question: - When is pylint considering that a class is implementing a given - interface ? - -Answer: - Pylint is using the Zope 2 interfaces conventions, and so is - considering that a class is implementing interfaces listed in its - __implements__ attribute. - - - -Question: - When is pylint considering a class as an abstract class ? - -Answer: - A class is considered as an abstract class if at least one of its - methods is doing nothing but raising NotImplementedError - - - -Question: - Is there some way to disable some message for a particular module - only ? - -Answer: - Yes, you can disable or enable (globally disabled) message at the - module level by adding the corresponding option in a comment at the - top of the file: :: - - # pylint: disable-msg=W0401, E0202 - # pylint: enable-msg=C0302 - - - -Question: - I have a mixin class relying on attributes of the mixed class, and I - would like to not have the "access to undefined member" message on - this class. Is it possible ? - -Answer: - Yes :o) To do so you have to set the ignore-mixin-members option to - "yes" (this is the default value) and to name your mixin class with - a name which ends with "mixin" (whatever case) - - - -Question: - Is it possible to locally disable a particular message for a block - of code or for a single line of code ? - -Answer: - Yes, this feature has been added in pylint 0.11. This may be done by - adding "#pylint: disable-msg=W0123,E4567" at the desired block level - or at the end of the desired line of code - - - -Question: - Where is the persistent data stored to make comparison between - two successive runs ? - -Answer: - Analysis data are stored as pickle file in a directory which is - localized using the following rules: - - * value of the PYLINTHOME environment variable if set - - * ".pylint.d" subdirectory of the user's home directory if it is found - (not always findable on Windows platforms) - - * ".pylint.d" directory in the current directory - - - -Question: - How can I know the option name (for pylintrc) corresponding to a - specific command line option ? - -Answer: - You can always generate a sample pylintrc file with --generate-rcfile - Every option present on the command line before this will be included in - the rc file - - For example:: - - pylint --disable-msg=W0702,C0103 --class-rgx='[A-Z][a-z]+' --generate-rcfile - - - -Question: - pychecker_ has no problem finding the imports and reporting on problems with - them, while pylint seems unable to deal with the same imports. Why ? - -Answer: - pychecker and pylint use different approaches. pychecker - imports the modules and rummages around in the result, hence it sees my - mangled sys.path. pylint doesn't import any of the candidate modules and - thus doesn't include any of import's side effects (good and bad). It - traverses an AST representation of the code. - - - +NOTICE: this problem should not occur with pylint >= 0.5 since from +this version pylint is not looking anymore for information in living +objects (i.e. it no longer imports analysed modules) .. _psyco: http://psyco.sf.net + +4.3 I have a callback function where I have no control over received arguments. How do I avoid getting unused argument warnings? +---------------------------------------------------------------------------------------------------------------------------------- + +Prefix (ui) the callback's name by `cb_`, as in cb_onclick(...). By +doing so arguments usage won't be checked. Another solution is to +use one of the names defined in the "dummy-variables" configuration +variable for unused argument ("_" and "dummy" by default). + +4.4 Is there a way to disable a message for a particular module only? +--------------------------------------------------------------------- + +Yes, you can disable or enable (globally disabled) messages at the +module level by adding the corresponding option in a comment at the +top of the file: :: + + # pylint: disable-msg=W0401, E0202 + # pylint: enable-msg=C0302 + +5. Classes and Inheritance +========================== + +5.1 When is pylint considering a class as an interface? +------------------------------------------------------- + +A class is considered as an interface if there is a class named "Interface" +somewhere in its inheritance tree. + +5.2 When is pylint considering that a class is implementing a given interface? +-------------------------------------------------------------------------------- + +Pylint is using the Zope 2 interfaces conventions, and so is +considering that a class is implementing interfaces listed in its +__implements__ attribute. + + +5.3 When is pylint considering a class as an abstract class? +------------------------------------------------------------- + +A class is considered as an abstract class if at least one of its +methods is doing nothing but raising NotImplementedError. + +5.4 How do I avoid "access to undefined member" messages in my mixin classes? +------------------------------------------------------------------------------- + +To do so you have to set the ignore-mixin-members option to +"yes" (this is the default value) and to name your mixin class with +a name which ends with "mixin" (whatever case). + + +6. Troubleshooting +================== + +6.1 Pylint gave my code a negative rating out of ten. That can't be right! +-------------------------------------------------------------------------- + +Even though the final rating Pylint renders is nominally out of ten, there's no +lower bound on it. By default, the formula to calculate score is :: + + 10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10) + +However, this option can be changed in the pylint rc file. If having negative +values really bugs you, you can set the formula to be the minimum of 0 and the +above expression. + + +6.2 Why does Pychecker catch problems with imports that Pylint doesn't? +------------------------------------------------------------------------ + +pychecker and pylint use different approaches. pychecker +imports the modules and rummages around in the result, hence it sees my +mangled sys.path. pylint doesn't import any of the candidate modules and +thus doesn't include any of import's side effects (good and bad). It +traverses an AST representation of the code. + +6.3 I think I found a bug in Pylint. What should I do? +------------------------------------------------------- + +First, you might wish to check Pylint's ticketing system (the 'Tickets' tab at +http://www.logilab.org/project/pylint), to make sure it hasn't been reported +already. If it hasn't, please send a bug report to [email protected]. + +Notice that if you don't find something you have expected in pylint's +tracker page, it may be on the tracker page of one of its dependencies, namely +astng and common: + +* http://www.logilab.org/project/name/logilab-astng +* http://www.logilab.org/project/name/logilab-common + +6.4 I have a question about Pylint that isn't answered here. +------------------------------------------------------------ + +The [email protected] mailing list is a great place to discuss and +ask questions about Pylint. This is a +moderated mailing list, so if you're not subscribed email you send will have to +be validated first before actually being sent on the list. + +You can subscribe to this mailing list at +http://lists.logilab.org/mailman/listinfo/python-projects + +Archives are available at +http://lists.logilab.org/pipermail/python-projects/ + +If you prefer speaking french instead of english, you can use the +generic [email protected] mailing list: + +* (un)subscribe: http://lists.logilab.org/mailman/listinfo/forum-fr +* archives: http://lists.logilab.org/pipermail/forum-fr + +Notice though that this list has a very low traffic since most pylint related +discussions are done on the python-projects mailing list. + .. _pychecker: http://pychecker.sf.net diff -r 16f098a0c3ae doc/beginner_pylint_tutorial.txt --- a/doc/beginner_pylint_tutorial.txt Tue Mar 30 14:54:42 2010 +0200 +++ b/doc/beginner_pylint_tutorial.txt Thu Apr 01 03:51:15 2010 -0400 @@ -19,7 +19,7 @@ desired outcome if people find your code hard to use or understand. The Python community has formalized some recommended programming styles to help everyone write code in a common, agreed-upon style that makes the most sense for shared -code. This style is captured in PEP-8. Pylint can be a quick and easy way of +code. This style is captured in PEP-8_. Pylint can be a quick and easy way of seeing if your code has captured the essence of PEP-8 and is therefore 'friendly' to other potential users. @@ -35,6 +35,8 @@ My command line prompt for these examples is: :: robertk01 Desktop$ + +.. _PEP-8: http://www.python.org/dev/peps/pep-0008/ Getting Started --------------- @@ -90,7 +92,7 @@ We'll use a basic python script as fodder for our tutorial. I borrowed extensively from the code here: http://www.daniweb.com/code/snippet748.html -The starting code we will use is called simplecaeser.py and is here in it's +The starting code we will use is called simplecaeser.py and is here in its entirety: :: 1 #!/usr/bin/env python @@ -364,7 +366,7 @@ No config file found, using default configuration Regular expressions can be quite a beast so take my word on this particular -example but go ahead and read up on them if you want. +example but go ahead and `read up`_ on them if you want. It would really be a pain in the butt to have to use all these options on the command line all the time. That's what the rc file is for. We can configure @@ -374,3 +376,5 @@ conquer the standards world by spreading your rc file...I dare you. That's it for the basic intro. More tutorials will follow. + +.. _`read up`: http://docs.python.org/library/re.html diff -r 16f098a0c3ae doc/commands.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc/commands.txt Thu Apr 01 03:51:15 2010 -0400 @@ -0,0 +1,169 @@ +================== +Pylint Commands +================== + ++---------------+------------+---------+---------------------------------------+ +| Command | Shortcut | Options | Description | ++===============+============+=========+=======================================+ +| rcfile | | file | Specify a configuration file. | ++---------------+------------+---------+---------------------------------------+ +| init-hook | | code |Python code to execute, usually for | +| | | |sys.path manipulation | ++---------------+------------+---------+---------------------------------------+ +| rpython-mode | | N/A |enable the rpython checker which is | +| | | |disabled by default | ++---------------+------------+---------+---------------------------------------+ +| errors-only | -e | |only the ERROR messages are displayed | ++---------------+------------+---------+---------------------------------------+ +| profile | |yes or no| Profiled execution | ++---------------+------------+---------+---------------------------------------+ +| ignore | | <file> |Add <file or directory> to ignored | ++---------------+------------+---------+---------------------------------------+ +| persistent | |yes or no|Pickle collected data | ++---------------+------------+---------+---------------------------------------+ +| help-msg | | msgid |Display a help message for message id | ++---------------+------------+---------+---------------------------------------+ +| list-msgs | | N/A | Generate pylint's full documentation.| ++---------------+------------+---------+---------------------------------------+ +|generate-rcfile| | |Generate a sample configuration file | +| | | |according to the current configuration | ++---------------+------------+---------+---------------------------------------+ +| cache-size | | size |Set the cache size for astng | ++---------------+------------+---------+---------------------------------------+ +| load-plugins | | |List of plugins to load | ++---------------+------------+---------+---------------------------------------+ +| generate-man | | |Generate pylint's man page | ++---------------+------------+---------+---------------------------------------+ +|enable-checker | | checker |Enable only checker(s) with given id(s)| ++---------------+------------+---------+---------------------------------------+ +|disable-checker| | checker |Disable checker(s) with given id(s) | ++---------------+------------+---------+---------------------------------------+ +|enable-msg-cat | | msg_cat |enable all messages in the categories | ++---------------+------------+---------+---------------------------------------+ +|disable-msg-cat| | msg_cat |Disable all messages in the categories | ++---------------+------------+---------+---------------------------------------+ +| enable-msg | | msg_id |Enable message(s) with the given id(s) | ++---------------+------------+---------+---------------------------------------+ +| disable-msg | | msg_id |Disable the message(s) with given id(s)| ++---------------+------------+---------+---------------------------------------+ +| output-format | |html,text| | +| | -f |parseable| Set the output format | +| | |msvs, | | +| | |colorized| | ++---------------+------------+---------+---------------------------------------+ +| include-ids | -i | msg_id |Include message's id in output | ++---------------+------------+---------+---------------------------------------+ +| files-output | | msg_id |Put messages in separate | +| | | |file for each module | ++---------------+------------+---------+---------------------------------------+ +| reports | -r |yes or no|Tells wether to display a full report | ++---------------+------------+---------+---------------------------------------+ +| evaluation | | eval_exp|Python expression for rating | ++---------------+------------+---------+---------------------------------------+ +| comment | |yes or no| Enable comment based on rating | ++---------------+------------+---------+---------------------------------------+ +| enable-report | | rep_id |Enable the report(s) with given id(s) | ++---------------+------------+---------+---------------------------------------+ +| disable-report| | rep_id |Disable the report(s) with given id(s) | ++---------------+------------+---------+---------------------------------------+ +| required- | | atts |Required attributes for module | +| attributes | | | | ++---------------+------------+---------+---------------------------------------+ +| no-docstring-| | regex |Regex for functions,classes, etc | +| rgx | | |which do not need a docstring | ++---------------+------------+---------+---------------------------------------+ +| module-rgx | | regex |Regex for good module names | ++---------------+------------+---------+---------------------------------------+ +| const-rgx | | regex |Regex for constants names | ++---------------+------------+---------+---------------------------------------+ +| class-rgx | | regex |Regex for class names | ++---------------+------------+---------+---------------------------------------+ +| function-rgx| | regex |Regex for function names | ++---------------+------------+---------+---------------------------------------+ +| method-rgx | | regex |Regex for method names | ++---------------+------------+---------+---------------------------------------+ +| attr-rgx | | regex |Regex for attribute names | ++---------------+------------+---------+---------------------------------------+ +| variable-rgx| | regex |Regex for variable names | ++---------------+------------+---------+---------------------------------------+ +| inlinevar-rgx | | regex |Regex for list comprehension names | ++---------------+------------+---------+---------------------------------------+ +| good-names | | list |List of accepted variable names | ++---------------+------------+---------+---------------------------------------+ +| bad-names | | list |List of rejected variable names | ++---------------+------------+---------+---------------------------------------+ +| bad-functions| | list |List of rejected function names | ++---------------+------------+---------+---------------------------------------+ +| ignore-mixin-| |yes or no|Tells wether missing members accessed | +| members | | |in mixin class should be ignored | ++---------------+------------+---------+---------------------------------------+ +| zope | |yes or no|consider the acquired-members option to| +| | | |ignore access to some undefined atts | ++---------------+------------+---------+---------------------------------------+ +| acquired- | | list |List of members which are usually get | +| members | | |through zope's acquisition mechanism | ++---------------+------------+---------+---------------------------------------+ +| init-import| |yes or no|check for unused import in init file | ++---------------+------------+---------+---------------------------------------+ +|dummy- | | regex |regular expression matching names used | +|variables-rgx | | |for dummy variables (i.e. not used) | ++---------------+------------+---------+---------------------------------------+ +|additional- | |yes or no|List of additional names supposed | +|builtins | | |to be defined in builtins | ++---------------+------------+---------+---------------------------------------+ +|ignore-iface- | | list |List of interface methods to ignore | +|methods | | | | ++---------------+------------+---------+---------------------------------------+ +|defining-attr- | | list |List of method names used to declare | +|methods | | |instance attributes | ++---------------+------------+---------+---------------------------------------+ +| max-args | | Integer |Maximum number of function arguments | ++---------------+------------+---------+---------------------------------------+ +| max-locals | | Integer |Maximum number of locals for function | ++---------------+------------+---------+---------------------------------------+ +|max-returns | | Integer |Maximum number of return | ++---------------+------------+---------+---------------------------------------+ +| max-branchs | | Integer |Maximum number of branch for function | ++---------------+------------+---------+---------------------------------------+ +| max-statements| | Integer |Maximum number of function statements | ++---------------+------------+---------+---------------------------------------+ +| max-parents | | Integer |Maximum number of parents for a class | ++---------------+------------+---------+---------------------------------------+ +|max-attributes | | Integer |Maximum num of attributes for a class | ++---------------+------------+---------+---------------------------------------+ +|min-public- | | Integer |Minimum number of public methods | +|methods | | |for a class | ++---------------+------------+---------+---------------------------------------+ +|max-public- | | Integer |Maximum number of public methods | +|methods | | |for a class | ++---------------+------------+---------+---------------------------------------+ +|deprecated- | | modules |Deprecated modules which should | +|modules | | |not be used | ++---------------+------------+---------+---------------------------------------+ +|import-graph | | file |Create a graph of every (i.e. internal | +| | | |and external) dependencies | ++---------------+------------+---------+---------------------------------------+ +|ext-import- | | file |Create a graph of external dependencies| +|graph | | | | ++---------------+------------+---------+---------------------------------------+ +|int-import- | | file |Create a graph of internal dependencies| +|graph | | | | ++---------------+------------+---------+---------------------------------------+ +|max-line-length| | Integer |Maximum number of characters on a line | +| | | | | ++---------------+------------+---------+---------------------------------------+ +|max-module- | | Integer |Maximum number of lines in a module | +|lines | | | | ++---------------+------------+---------+---------------------------------------+ +|indent-string | | String |String used as indentation unit | +| | | | | ++---------------+------------+---------+---------------------------------------+ +|min-similarity-| | Integer |Minimum lines number of a similarity | +|lines | | | | ++---------------+------------+---------+---------------------------------------+ +|ignore-comments| |yes or no|Ignore comments when computing | +| | | |similarities | ++---------------+------------+---------+---------------------------------------+ +|ignore- | |yes or no|Ignore docstrings when computing | +|docstrings | | |similarities | ++---------------+------------+---------+---------------------------------------+ diff -r 16f098a0c3ae doc/manual.txt --- a/doc/manual.txt Tue Mar 30 14:54:42 2010 +0200 +++ b/doc/manual.txt Thu Apr 01 03:51:15 2010 -0400 @@ -183,7 +183,7 @@ interface. It is also possible to call Pylint from an other Python program, -thanks ``py_run()`` function in ``lint`` module, +thanks to ``py_run()`` function in ``lint`` module, assuming Pylint options are stored in ``pylint_options`` string, as :: from pylint import lint @@ -200,7 +200,7 @@ ------------- The default format for the output is raw text. But passing pylint the -``--output-format=html`` option will produce an HTML document. +``--output-format=html`` or ``-h y`` or ``-o html`` option will produce an HTML document. There are several sections in pylint's output. @@ -589,8 +589,20 @@ .. _mercurial: http://www.selenic.com/mercurial/ +Contribution Instructions +-------------------------- +Got a patch for pylint? There a few steps you must take then to make sure your +patch gets accepted. - +* Test your code + * Pylint has a very specific testing framework to get your patch accepted you must write a test input file and message file in the appropriate input and messages folders. + * In the test folder of pylint run ./fulltest.sh (python version), make sure all tests pass before submitting a patch +* Create a mercurial diff file + * To create a mercurial diff on the command line (in the pylint folder)evoke :: + hg diff > <yourname>.txt + +* E-Mail the mailing list with your diff file + Other information ================= diff -r 16f098a0c3ae doc/quickstart.txt --- a/doc/quickstart.txt Tue Mar 30 14:54:42 2010 +0200 +++ b/doc/quickstart.txt Thu Apr 01 03:51:15 2010 -0400 @@ -19,7 +19,7 @@ --------------- Pylint is a tool that checks for errors in python code, tries to -enforce a coding standard and looks for smelling code . This is +enforce a coding standard and looks for bad code smells. This is similar but nevertheless different from what pychecker_ provides, especially since pychecker explicitly does not bother with coding style. The default coding style used by pylint is close to @@ -81,7 +81,7 @@ ------------- The default format for the output is raw text. But passing pylint the -``--output-format=html`` option will produce an HTML document. +``--output-format=html`` or ``-f html`` option will produce an HTML document. There are several sections in pylint's output.
_______________________________________________ Python-Projects mailing list [email protected] http://lists.logilab.org/mailman/listinfo/python-projects
