]> git.openstreetmap.org Git - nominatim.git/commitdiff
Merge pull request #2296 from lonvia/disable-too-few-public-methods-check
authorSarah Hoffmann <lonvia@denofr.de>
Sat, 24 Apr 2021 13:03:28 +0000 (15:03 +0200)
committerGitHub <noreply@github.com>
Sat, 24 Apr 2021 13:03:28 +0000 (15:03 +0200)
pylint: disable too-few-public-methods check

.pylintrc
nominatim/clicmd/args.py
nominatim/config.py
nominatim/db/sql_preprocessor.py
nominatim/tools/check_database.py
nominatim/tools/special_phrases.py

index eab041818058526209a36951c902e615095d7d23..65f97b146ac9ac27ff8a039a3c13dc427a5fe473 100644 (file)
--- a/.pylintrc
+++ b/.pylintrc
@@ -10,3 +10,4 @@ ignored-modules=icu
 # closing added here because it sometimes triggers a false positive with
 # 'with' statements.
 ignored-classes=NominatimArgs,closing
+disable=too-few-public-methods
index 47007579f6f69cf1a97edac668c8646ed2046d40..ee1941875d56b8c1007cf6bea1d222672080fd22 100644 (file)
@@ -3,7 +3,7 @@ Provides custom functions over command-line arguments.
 """
 
 
-class NominatimArgs: # pylint: disable=too-few-public-methods
+class NominatimArgs:
     """ Customized namespace class for the nominatim command line tool
         to receive the command-line arguments.
     """
index 1db564938c78479c19107082be204c17bbb53c15..72aaf0bd6b436ed78322f39ccec34feb560d542d 100644 (file)
@@ -39,7 +39,7 @@ class Configuration:
             self._config['NOMINATIM_ADDRESS_LEVEL_CONFIG'] = \
                 str(config_dir / 'address-levels.json')
 
-        class _LibDirs: # pylint: disable=too-few-public-methods
+        class _LibDirs:
             pass
 
         self.lib_dir = _LibDirs()
index c7009b34fc0a7b1e9d8a3a0717d8ac875a7c9b41..9e0b291298d7739993c6447db4ca159ae517fe40 100644 (file)
@@ -64,7 +64,7 @@ def _setup_postgresql_features(conn):
         'has_index_non_key_column' : pg_version >= (11, 0, 0)
     }
 
-class SQLPreprocessor: # pylint: disable=too-few-public-methods
+class SQLPreprocessor:
     """ A environment for preprocessing SQL files from the
         lib-sql directory.
 
index 00393d15d09dd5729becce61db687c9881376990..479a28a3f89bcf164adb1ff5723c9ad7d57bb54c 100644 (file)
@@ -47,7 +47,7 @@ def _check(hint=None):
 
     return decorator
 
-class _BadConnection: # pylint: disable=R0903
+class _BadConnection:
 
     def __init__(self, msg):
         self.msg = msg
index 28a077012024ac3bc49d60f18be87c382e05a0b9..f4eec260c529c13e3a1d0235eaa5230669f2f16f 100644 (file)
@@ -3,20 +3,21 @@
 """
 import logging
 import os
+from os.path import isfile
 from pathlib import Path
 import re
 import subprocess
 import json
-from os.path import isfile
+
 from icu import Transliterator
 from psycopg2.sql import Identifier, Literal, SQL
+
 from nominatim.tools.exec_utils import get_url
 from nominatim.errors import UsageError
 
 LOG = logging.getLogger()
 class SpecialPhrasesImporter():
     # pylint: disable-msg=too-many-instance-attributes
-    # pylint: disable-msg=too-few-public-methods
     """
         Class handling the process of special phrases importations.
     """
@@ -152,7 +153,7 @@ class SpecialPhrasesImporter():
         type_matchs = self.sanity_check_pattern.findall(phrase_type)
         class_matchs = self.sanity_check_pattern.findall(phrase_class)
 
-        if len(class_matchs) < 1 or len(type_matchs) < 1:
+        if not class_matchs or not type_matchs:
             LOG.warning("Bad class/type for language %s: %s=%s. It will not be imported",
                         lang, phrase_class, phrase_type)
             return False