]> git.openstreetmap.org Git - nominatim.git/commitdiff
pylint: disable no-self-use check
authorSarah Hoffmann <lonvia@denofr.de>
Wed, 11 May 2022 08:25:00 +0000 (10:25 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Wed, 11 May 2022 08:25:00 +0000 (10:25 +0200)
This checker encourages bad behaviour (namely changing the static
status of a function during inheritence) and will be made optional
in upcoming versions of pylint.

.pylintrc
nominatim/tokenizer/icu_tokenizer.py
nominatim/tokenizer/legacy_tokenizer.py

index 89135138d5c5c183302be40865496c7eef5fd57c..fef53872118c6a034286b6490afcd939f889ef11 100644 (file)
--- a/.pylintrc
+++ b/.pylintrc
@@ -11,6 +11,6 @@ ignored-modules=icu,datrie
 # 'with' statements.
 ignored-classes=NominatimArgs,closing
 # 'too-many-ancestors' is triggered already by deriving from UserDict
-disable=too-few-public-methods,duplicate-code,too-many-ancestors,bad-option-value
+disable=too-few-public-methods,duplicate-code,too-many-ancestors,bad-option-value,no-self-use
 
 good-names=i,x,y,fd,db
index 9c7138ce67fa5174d0e947c72bf7a71313fe3435..bf5544ed0c06064946bef2b48fa9c217a5312c29 100644 (file)
@@ -278,8 +278,7 @@ class LegacyICUNameAnalyzer(AbstractAnalyzer):
                + [(k, v, part_ids.get(v, None)) for k, v in partial_tokens.items()]
 
 
-    @staticmethod
-    def normalize_postcode(postcode):
+    def normalize_postcode(self, postcode):
         """ Convert the postcode to a standardized form.
 
             This function must yield exactly the same result as the SQL function
index 299e2fdecc2289f8e0848cc07d6e9c9bc082b600..7b78b22a87066370bba513072b0ace30c7b7078a 100644 (file)
@@ -337,8 +337,7 @@ class LegacyNameAnalyzer(AbstractAnalyzer):
         return self.normalizer.transliterate(phrase)
 
 
-    @staticmethod
-    def normalize_postcode(postcode):
+    def normalize_postcode(self, postcode):
         """ Convert the postcode to a standardized form.
 
             This function must yield exactly the same result as the SQL function