summaryrefslogtreecommitdiffstats
path: root/gitlint-core/gitlint/utils.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-11-19 14:52:46 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-11-19 14:52:46 +0000
commita2aa51f5702b18016c25d943499941323952704d (patch)
tree7ee43f79639ee53903e7ca389e548974e1497c3a /gitlint-core/gitlint/utils.py
parentAdding upstream version 0.17.0. (diff)
downloadgitlint-a2aa51f5702b18016c25d943499941323952704d.tar.xz
gitlint-a2aa51f5702b18016c25d943499941323952704d.zip
Adding upstream version 0.18.0.upstream/0.18.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'gitlint-core/gitlint/utils.py')
-rw-r--r--gitlint-core/gitlint/utils.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/gitlint-core/gitlint/utils.py b/gitlint-core/gitlint/utils.py
index c91184b..697b472 100644
--- a/gitlint-core/gitlint/utils.py
+++ b/gitlint-core/gitlint/utils.py
@@ -11,7 +11,7 @@ import locale
# and just executed at import-time.
########################################################################################################################
-LOG_FORMAT = '%(levelname)s: %(name)s %(message)s'
+LOG_FORMAT = "%(levelname)s: %(name)s %(message)s"
########################################################################################################################
# PLATFORM_IS_WINDOWS
@@ -31,10 +31,10 @@ PLATFORM_IS_WINDOWS = platform_is_windows()
def use_sh_library():
- gitlint_use_sh_lib_env = os.environ.get('GITLINT_USE_SH_LIB', None)
+ gitlint_use_sh_lib_env = os.environ.get("GITLINT_USE_SH_LIB", None)
if gitlint_use_sh_lib_env:
return gitlint_use_sh_lib_env == "1"
- return not PLATFORM_IS_WINDOWS
+ return False
USE_SH_LIB = use_sh_library()
@@ -44,8 +44,8 @@ USE_SH_LIB = use_sh_library()
def getpreferredencoding():
- """ Modified version of local.getpreferredencoding() that takes into account LC_ALL, LC_CTYPE, LANG env vars
- on windows and falls back to UTF-8. """
+ """Modified version of local.getpreferredencoding() that takes into account LC_ALL, LC_CTYPE, LANG env vars
+ on windows and falls back to UTF-8."""
fallback_encoding = "UTF-8"
default_encoding = locale.getpreferredencoding() or fallback_encoding
@@ -61,7 +61,7 @@ def getpreferredencoding():
# If encoding contains a dot: split and use second part, otherwise use everything
dot_index = encoding.find(".")
if dot_index != -1:
- default_encoding = encoding[dot_index + 1:]
+ default_encoding = encoding[dot_index + 1 :]
else:
default_encoding = encoding
break