You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pre-commit will fail with ValueError: path is on mount 'C:', start on mount 'D:' when the config file is on C:\ but the git repository is on D:\
Steps to reproduce:
Create config file on your C: drive (for example %USERPROFILE%\.pre-commit-config.yaml)
Create git repo on D: drive
Run pre-commit: pre-commit run --config=%USERPROFILE%\.pre-commit-config.yaml
Commenting out line 164 in main.py (args.config = os.path.relpath(args.config)) fixes this issue. Is it necessary that the config path is relative to the working directory?
pre-commit version: 2.20.0
git --version: git version 2.36.1
sys.version:
3.9.9 (tags/v3.9.9:ccb0e6a, Nov 15 2021, 18:08:50) [MSC v.1929 64 bit (AMD64)]
sys.executable: D:\temp\prctest\venv\Scripts\python.exe
os.name: nt
sys.platform: win32
error information
An unexpected error has occurred: ValueError: path is on mount 'C:', start on mount 'D:'
Traceback (most recent call last):
File "D:\temp\prctest\venv\lib\site-packages\pre_commit\error_handler.py", line 73, in error_handler
yield
File "D:\temp\prctest\venv\lib\site-packages\pre_commit\main.py", line 343, in main
_adjust_args_and_chdir(args)
File "D:\temp\prctest\venv\lib\site-packages\pre_commit\main.py", line 164, in _adjust_args_and_chdir
args.config = os.path.relpath(args.config)
File "D:\local_software\PYTHON\3.9.9\Windows_NT.x64\lib\ntpath.py", line 703, in relpath
raise ValueError("path is on mount %r, start on mount %r" % (
ValueError: path is on mount 'C:', start on mount 'D:'
The text was updated successfully, but these errors were encountered:
search tried in the issue tracker
is:issue relpath
describe your issue
pre-commit will fail with
ValueError: path is on mount 'C:', start on mount 'D:'
when the config file is onC:\
but the git repository is onD:\
Steps to reproduce:
C:
drive (for example%USERPROFILE%\.pre-commit-config.yaml
)D:
drivepre-commit run --config=%USERPROFILE%\.pre-commit-config.yaml
Commenting out line 164 in
main.py
(args.config = os.path.relpath(args.config)
) fixes this issue. Is it necessary that the config path is relative to the working directory?pre-commit --version
pre-commit 2.20.0
.pre-commit-config.yaml
~/.cache/pre-commit/pre-commit.log (if present)
version information
error information
The text was updated successfully, but these errors were encountered: