]> git.mxchange.org Git - fba.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Fri, 23 Jun 2023 16:32:54 +0000 (18:32 +0200)
committerRoland Häder <roland@mxchange.org>
Fri, 23 Jun 2023 16:32:54 +0000 (18:32 +0200)
- added 'r' to avoid anomalous-backslash-in-string lint-check

fba/helpers/tidyup.py
fba/helpers/version.py
pylint.rc

index 8d8ff40515aef90c06d95d55507548c79f6baa70..5611e65d97dc49f804c1abdce60e41cefb5dfeef 100644 (file)
@@ -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/"):
index b83071421bfa222175b5653b37cabcc6d722a111..96ba574f504f4ddaa836e1be24aece1d2b13ef67 100644 (file)
@@ -22,11 +22,11 @@ logger = logging.getLogger(__name__)
 # Pattern instance for version numbers
 patterns = [
     # semantic version number (with v|V) prefix)
-    re.compile("^(?P<version>v|V{0,1})(\.{0,1})(?P<major>0|[1-9]\d*)\.(?P<minor>0+|[1-9]\d*)(\.(?P<patch>0+|[1-9]\d*)(?:-(?P<prerelease>(?: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<buildmetadata>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)?$"),
+    re.compile(r"^(?P<version>v|V{0,1})(\.{0,1})(?P<major>0|[1-9]\d*)\.(?P<minor>0+|[1-9]\d*)(\.(?P<patch>0+|[1-9]\d*)(?:-(?P<prerelease>(?: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<buildmetadata>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)?$"),
     # non-sematic, e.g. 1.2.3.4
-    re.compile("^(?P<version>v|V{0,1})(\.{0,1})(?P<major>0|[1-9]\d*)\.(?P<minor>0+|[1-9]\d*)(\.(?P<patch>0+|[1-9]\d*)(\.(?P<subpatch>0|[1-9]\d*))?)$"),
+    re.compile(r"^(?P<version>v|V{0,1})(\.{0,1})(?P<major>0|[1-9]\d*)\.(?P<minor>0+|[1-9]\d*)(\.(?P<patch>0+|[1-9]\d*)(\.(?P<subpatch>0|[1-9]\d*))?)$"),
     # non-sematic, e.g. 2023-05[-dev]
-    re.compile("^(?P<year>[1-9]{1}[0-9]{3})\.(?P<month>[0-9]{2})(-dev){0,1}$"),
+    re.compile(r"^(?P<year>[1-9]{1}[0-9]{3})\.(?P<month>[0-9]{2})(-dev){0,1}$"),
     # non-semantic, e.g. abcdef0
     re.compile("^[a-f0-9]{7}$"),
 ]
index e57bed4e00060ddfb47c74032665857cb0088ad8..e9b0d0925d3524ffc80eb1f2f5abf47ee7f0b054 100644 (file)
--- 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