From 397a47ff6cf0d5e2be405ed78e80a4e466bc8fbf Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Fri, 23 Jun 2023 18:32:54 +0200 Subject: [PATCH] Continued: - added 'r' to avoid anomalous-backslash-in-string lint-check --- fba/helpers/tidyup.py | 10 +++++----- fba/helpers/version.py | 6 +++--- pylint.rc | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/fba/helpers/tidyup.py b/fba/helpers/tidyup.py index 8d8ff40..5611e65 100644 --- a/fba/helpers/tidyup.py +++ b/fba/helpers/tidyup.py @@ -40,24 +40,24 @@ def domain(string: str) -> str: logger.debug("string='%s' - #1", string) # No port number - string = re.sub("\:\d+$", "", string) + string = re.sub(r"\:\d+$", "", string) logger.debug("string='%s' - #2", string) # No protocol, sometimes without the slashes - string = re.sub("^https?\:(\/*)", "", string) + string = re.sub(r"^https?\:(\/*)", "", string) logger.debug("string='%s' - #3", string) # No trailing slash - string = re.sub("\/$", "", string) + string = re.sub(r"\/$", "", string) logger.debug("string='%s' - #4", string) # No @ or : sign - string = re.sub("^\@", "", string) + string = re.sub(r"^\@", "", string) string = string.split(":")[0] logger.debug("string='%s' - #5", string) # No individual users in block lists - string = re.sub("(.+)\@", "", string) + string = re.sub(r"(.+)\@", "", string) logger.debug("string='%s' - #6", string) if string.find("/profile/"): diff --git a/fba/helpers/version.py b/fba/helpers/version.py index b830714..96ba574 100644 --- a/fba/helpers/version.py +++ b/fba/helpers/version.py @@ -22,11 +22,11 @@ logger = logging.getLogger(__name__) # Pattern instance for version numbers patterns = [ # semantic version number (with v|V) prefix) - re.compile("^(?Pv|V{0,1})(\.{0,1})(?P0|[1-9]\d*)\.(?P0+|[1-9]\d*)(\.(?P0+|[1-9]\d*)(?:-(?P(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?P[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)?$"), + re.compile(r"^(?Pv|V{0,1})(\.{0,1})(?P0|[1-9]\d*)\.(?P0+|[1-9]\d*)(\.(?P0+|[1-9]\d*)(?:-(?P(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?P[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)?$"), # non-sematic, e.g. 1.2.3.4 - re.compile("^(?Pv|V{0,1})(\.{0,1})(?P0|[1-9]\d*)\.(?P0+|[1-9]\d*)(\.(?P0+|[1-9]\d*)(\.(?P0|[1-9]\d*))?)$"), + re.compile(r"^(?Pv|V{0,1})(\.{0,1})(?P0|[1-9]\d*)\.(?P0+|[1-9]\d*)(\.(?P0+|[1-9]\d*)(\.(?P0|[1-9]\d*))?)$"), # non-sematic, e.g. 2023-05[-dev] - re.compile("^(?P[1-9]{1}[0-9]{3})\.(?P[0-9]{2})(-dev){0,1}$"), + re.compile(r"^(?P[1-9]{1}[0-9]{3})\.(?P[0-9]{2})(-dev){0,1}$"), # non-semantic, e.g. abcdef0 re.compile("^[a-f0-9]{7}$"), ] diff --git a/pylint.rc b/pylint.rc index e57bed4..e9b0d09 100644 --- a/pylint.rc +++ b/pylint.rc @@ -60,7 +60,7 @@ confidence= # --enable=similarities". If you want to run only the classes checker, but have # no Warning level messages displayed, use "--disable=all --enable=classes # --disable=W". -disable=anomalous-backslash-in-string,duplicate-code,no-else-raise +disable= # Enable the message, report, category or checker with the given id(s). You can # either give multiple identifier separated by comma (,) or put this option -- 2.39.5