diff options
author | Torsten Marek <shlomme@gmail.com> | 2014-07-24 14:13:09 +0200 |
---|---|---|
committer | Torsten Marek <shlomme@gmail.com> | 2014-07-24 14:13:09 +0200 |
commit | faae5267f9541ffbce013f3505e26295698a43b9 (patch) | |
tree | 9f309e21d8f3184da5d80cde0253d4abb62c53a0 /doc | |
parent | 54e8ee1d68f66b5a9f89d48209c24494a56d68d9 (diff) | |
download | pylint-faae5267f9541ffbce013f3505e26295698a43b9.tar.gz |
Change the multi-style name checker from first-style-wins to majority-style-wins.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/options.rst | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/doc/options.rst b/doc/options.rst index 4a159f2..702d93c 100644 --- a/doc/options.rst +++ b/doc/options.rst @@ -91,8 +91,8 @@ However, intra-module consistency should still be required, to make changes inside a single file easier. For this case, PyLint supports regular expression with several named capturing group. -The capturing group of the first valid match taints the module and enforces the -same group to be triggered on every subsequent occurrence of this name. +Rather than emitting name warnings immediately, PyLint will determine the +prevalent naming style inside each module and enforce it on all names. Consider the following (simplified) example:: @@ -101,16 +101,17 @@ Consider the following (simplified) example:: The regular expression defines two naming styles, ``snake`` for snake-case names, and ``camel`` for camel-case names. -In ``sample.py``, the function name on line 1 will taint the module and enforce -the match of named group ``snake`` for the remainder of the module:: +In ``sample.py``, the function name on line 1 and 7 will mark the module +and enforce the match of named group ``snake`` for the remaining names in +the module:: - def trigger_snake_case(arg): + def valid_snake_case(arg): ... def InvalidCamelCase(arg): ... - def valid_snake_case(arg): + def more_valid_snake_case(arg): ... Because of this, the name on line 4 will trigger an ``invalid-name`` warning, |