Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ repos:
verbose: true
files: ^db\.py|README\.md$

- rev: v0.15.0
- rev: v0.17.5
repo: https://github.com/astral-sh/ruff-pre-commit
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format

- repo: https://github.com/pdm-project/pdm
rev: 2.26.6
rev: 2.29.7
hooks:
- id: pdm-lock-check
2,870 changes: 1,693 additions & 1,177 deletions pdm.lock

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion src/sync_pre_commit_lock/_compat.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# ruff: noqa: F401
try:
# 3.11+
import tomllib as toml # type: ignore[import,unused-ignore]
Expand Down
2 changes: 1 addition & 1 deletion src/sync_pre_commit_lock/actions/install_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def _are_pre_commit_hooks_installed(git_root: Path) -> bool:

def _get_git_directory_path(self) -> Path | None:
try:
result = subprocess.check_output( # noqa: S603
result = subprocess.check_output(
["git", "rev-parse", "--show-toplevel"], # noqa: S607
stderr=subprocess.PIPE,
)
Expand Down
3 changes: 2 additions & 1 deletion src/sync_pre_commit_lock/actions/sync_hooks.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from __future__ import annotations

from collections.abc import Sequence
from functools import cached_property
from typing import TYPE_CHECKING, NamedTuple, Sequence
from typing import TYPE_CHECKING, NamedTuple

from packaging.requirements import InvalidRequirement, Requirement
from packaging.specifiers import SpecifierSet
Expand Down
3 changes: 2 additions & 1 deletion src/sync_pre_commit_lock/config.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
from __future__ import annotations

import os
from collections.abc import Callable
from dataclasses import dataclass, field
from enum import Enum
from pathlib import Path
from typing import TYPE_CHECKING, Any, Callable, TypedDict
from typing import TYPE_CHECKING, Any, TypedDict

from ._compat import toml

Expand Down
2 changes: 1 addition & 1 deletion src/sync_pre_commit_lock/pdm_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def on_pdm_install_setup_pre_commit(project: Project, *, dry_run: bool, **_: Any
Resolution = Union[dict[str, list[Candidate]], dict[str, Candidate]]


def select_candidate(candidate: Union[Candidate, list[Candidate]]) -> Candidate | None:
def select_candidate(candidate: Candidate | list[Candidate]) -> Candidate | None:
if isinstance(candidate, Iterable):
return next(iter(candidate), None)
return candidate
Expand Down
6 changes: 2 additions & 4 deletions src/sync_pre_commit_lock/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,12 @@ def normalize_git_url(url: str) -> str:
path = parsed_url.path

# Remove .git from the end of path if it's there
if path.endswith(".git"):
path = path[:-4]
path = path.removesuffix(".git")

# Reconstruct the URL
normalized_url = urlunparse((scheme, netloc, path, None, None, None))

if normalized_url.endswith("/"):
normalized_url = normalized_url[:-1]
normalized_url = normalized_url.removesuffix("/")

return normalized_url

Expand Down
1 change: 0 additions & 1 deletion tests/test_pdm/test_pdm_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import pytest

pdm_module = pytest.importorskip("pdm")
# ruff: noqa: E402
from pdm.core import Core
from pdm.project import Project
from pdm.termui import UI
Expand Down
1 change: 0 additions & 1 deletion tests/test_pdm/test_pdm_sync_pre_commit_hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from packaging.version import Version

pdm_module = pytest.importorskip("pdm")
# ruff: noqa: E402
from pdm.__version__ import __version__ as pdm_version
from pdm.core import Core
from pdm.models.candidates import Candidate
Expand Down
1 change: 0 additions & 1 deletion tests/test_poetry/test_poetry_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import pytest

poetry_module = pytest.importorskip("poetry")
# ruff: noqa: E402
from cleo.events.console_terminate_event import ConsoleTerminateEvent
from poetry.console.application import Application
from poetry.console.commands.install import InstallCommand
Expand Down
Loading