From faae5267f9541ffbce013f3505e26295698a43b9 Mon Sep 17 00:00:00 2001 From: Torsten Marek Date: Thu, 24 Jul 2014 14:13:09 +0200 Subject: Change the multi-style name checker from first-style-wins to majority-style-wins. --- doc/options.rst | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'doc') 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, -- cgit v1.2.1