mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
More miscellaneous cleanup
This commit is contained in:
parent
489d9f9926
commit
df40e862f4
33 changed files with 209 additions and 296 deletions
|
|
@ -32,7 +32,7 @@ def _state(additional_deps: Sequence[str]) -> object:
|
|||
|
||||
|
||||
def _state_filename(prefix: Prefix, venv: str) -> str:
|
||||
return prefix.path(venv, '.install_state_v' + C.INSTALLED_STATE_VERSION)
|
||||
return prefix.path(venv, f'.install_state_v{C.INSTALLED_STATE_VERSION}')
|
||||
|
||||
|
||||
def _read_state(prefix: Prefix, venv: str) -> Optional[object]:
|
||||
|
|
@ -46,7 +46,7 @@ def _read_state(prefix: Prefix, venv: str) -> Optional[object]:
|
|||
|
||||
def _write_state(prefix: Prefix, venv: str, state: object) -> None:
|
||||
state_filename = _state_filename(prefix, venv)
|
||||
staging = state_filename + 'staging'
|
||||
staging = f'{state_filename}staging'
|
||||
with open(staging, 'w') as state_file:
|
||||
state_file.write(json.dumps(state))
|
||||
# Move the file into place atomically to indicate we've installed
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue