mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-15 16:10:16 +00:00
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
72ad6dc953
commit
f4cd1ba0d6
813 changed files with 66015 additions and 58839 deletions
|
|
@ -5,6 +5,7 @@ compatible for the current pip code base.
|
|||
The intention is to rewrite current usages gradually, keeping the tests pass,
|
||||
and eventually drop this after all usages are changed.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
|
@ -24,7 +25,7 @@ def _macos_user_config_dir(appname: str, roaming: bool = True) -> str:
|
|||
return path
|
||||
|
||||
# Use a Linux-like ~/.config/pip, by default.
|
||||
linux_like_path = "~/.config/"
|
||||
linux_like_path = '~/.config/'
|
||||
if appname:
|
||||
linux_like_path = os.path.join(linux_like_path, appname)
|
||||
|
||||
|
|
@ -32,7 +33,7 @@ def _macos_user_config_dir(appname: str, roaming: bool = True) -> str:
|
|||
|
||||
|
||||
def user_config_dir(appname: str, roaming: bool = True) -> str:
|
||||
if sys.platform == "darwin":
|
||||
if sys.platform == 'darwin':
|
||||
return _macos_user_config_dir(appname, roaming)
|
||||
|
||||
return _appdirs.user_config_dir(appname, appauthor=False, roaming=roaming)
|
||||
|
|
@ -40,13 +41,13 @@ def user_config_dir(appname: str, roaming: bool = True) -> str:
|
|||
|
||||
# for the discussion regarding site_config_dir locations
|
||||
# see <https://github.com/pypa/pip/issues/1733>
|
||||
def site_config_dirs(appname: str) -> List[str]:
|
||||
if sys.platform == "darwin":
|
||||
def site_config_dirs(appname: str) -> list[str]:
|
||||
if sys.platform == 'darwin':
|
||||
return [_appdirs.site_data_dir(appname, appauthor=False, multipath=True)]
|
||||
|
||||
dirval = _appdirs.site_config_dir(appname, appauthor=False, multipath=True)
|
||||
if sys.platform == "win32":
|
||||
if sys.platform == 'win32':
|
||||
return [dirval]
|
||||
|
||||
# Unix-y system. Look in /etc as well.
|
||||
return dirval.split(os.pathsep) + ["/etc"]
|
||||
return dirval.split(os.pathsep) + ['/etc']
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue