github-rest-api 0.52.0__py3-none-any.whl → 0.53.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- github_rest_api/scripts/lint_repo.py +14 -3
- {github_rest_api-0.52.0.dist-info → github_rest_api-0.53.1.dist-info}/METADATA +1 -1
- {github_rest_api-0.52.0.dist-info → github_rest_api-0.53.1.dist-info}/RECORD +5 -5
- {github_rest_api-0.52.0.dist-info → github_rest_api-0.53.1.dist-info}/WHEEL +0 -0
- {github_rest_api-0.52.0.dist-info → github_rest_api-0.53.1.dist-info}/entry_points.txt +0 -0
|
@@ -22,6 +22,7 @@ import argparse
|
|
|
22
22
|
import os
|
|
23
23
|
import re
|
|
24
24
|
import shutil
|
|
25
|
+
import stat
|
|
25
26
|
import subprocess as sp
|
|
26
27
|
import sys
|
|
27
28
|
from collections.abc import Callable, Sequence
|
|
@@ -29,6 +30,7 @@ from dataclasses import dataclass, field
|
|
|
29
30
|
from pathlib import Path
|
|
30
31
|
from typing import Literal, cast
|
|
31
32
|
|
|
33
|
+
from dulwich.index import IndexEntry
|
|
32
34
|
from dulwich.repo import Repo
|
|
33
35
|
|
|
34
36
|
#: The outcome of running one check.
|
|
@@ -44,6 +46,12 @@ LANGUAGES = ["python", "rust", "golang", "bash", "fish", "lua", "markdown"]
|
|
|
44
46
|
def list_tracked_files(root: Path) -> list[str]:
|
|
45
47
|
"""List all git-tracked files in a repository.
|
|
46
48
|
|
|
49
|
+
Symbolic links are excluded: a link's content is linted through its
|
|
50
|
+
target (when tracked), and linting the link too would run every check
|
|
51
|
+
twice on the same content -- or, worse, with conflicting options (e.g. a
|
|
52
|
+
`CLAUDE.md` -> `AGENTS.md` link would get a different mdformat flavor than
|
|
53
|
+
its target).
|
|
54
|
+
|
|
47
55
|
:param root: The root directory of the git repository (not an arbitrary
|
|
48
56
|
subdirectory of one -- the returned paths, and every command a check
|
|
49
57
|
later runs, are relative to this exact directory).
|
|
@@ -54,7 +62,10 @@ def list_tracked_files(root: Path) -> list[str]:
|
|
|
54
62
|
# `surrogateescape` so a non-UTF-8 filename (which git tracks fine)
|
|
55
63
|
# doesn't crash the whole run; it just won't print legibly.
|
|
56
64
|
return sorted(
|
|
57
|
-
name.decode(errors="surrogateescape")
|
|
65
|
+
name.decode(errors="surrogateescape")
|
|
66
|
+
for name, entry in repo.open_index().items()
|
|
67
|
+
# A conflicted entry (mid-merge) has no single mode; keep it.
|
|
68
|
+
if not (isinstance(entry, IndexEntry) and stat.S_ISLNK(entry.mode))
|
|
58
69
|
)
|
|
59
70
|
finally:
|
|
60
71
|
repo.close()
|
|
@@ -363,7 +374,7 @@ def build_markdown_checks(files: Sequence[str], fix: bool = False) -> list[Check
|
|
|
363
374
|
md_files = _files_matching(files, "*.md")
|
|
364
375
|
if not md_files:
|
|
365
376
|
return []
|
|
366
|
-
skill_files = [f for f in md_files if Path(f).name
|
|
377
|
+
skill_files = [f for f in md_files if Path(f).name in ("SKILL.md", "AGENTS.md")]
|
|
367
378
|
other_files = [f for f in md_files if f not in skill_files]
|
|
368
379
|
checks = []
|
|
369
380
|
if other_files:
|
|
@@ -380,7 +391,7 @@ def build_markdown_checks(files: Sequence[str], fix: bool = False) -> list[Check
|
|
|
380
391
|
if skill_files:
|
|
381
392
|
checks.append(
|
|
382
393
|
Check(
|
|
383
|
-
"markdown: mdformat (SKILL.md)",
|
|
394
|
+
"markdown: mdformat (SKILL.md/AGENTS.md)",
|
|
384
395
|
command=_cmd(
|
|
385
396
|
fix,
|
|
386
397
|
["mdformat", "--number", *skill_files],
|
|
@@ -3,7 +3,7 @@ github_rest_api/github.py,sha256=DoppuRup4F0sor5fQz7wWQ87KWr6NSHXmYmHXuxPwSI,698
|
|
|
3
3
|
github_rest_api/pr_content.py,sha256=og1VwsMtwqwl-HUJcJrkwjUjFPw9E1k5xDtJVMAXBRo,10039
|
|
4
4
|
github_rest_api/utils.py,sha256=it5zHCNhXTut4M-PWR-BtWm63_rpFSc_xRc4rbDJ8Qw,3496
|
|
5
5
|
github_rest_api/scripts/__init__.py,sha256=NkHTngnnWXPc0JmO5mqVKjDf4JPofuwWjDW1SU3aE7Y,36
|
|
6
|
-
github_rest_api/scripts/lint_repo.py,sha256=
|
|
6
|
+
github_rest_api/scripts/lint_repo.py,sha256=RvQbN0QuktCVlxI0CP960AkRo0CMy55qPQJk93r4yds,28569
|
|
7
7
|
github_rest_api/scripts/utils.py,sha256=qpyRqlXLpxWX0BByr6hKjvmTmK5LjdHgoujIgOJ6pIM,7869
|
|
8
8
|
github_rest_api/scripts/cargo/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
9
|
github_rest_api/scripts/cargo/benchmark.py,sha256=wtxM9nQxELEUliWu8EGWqb42TRTOK9ufj4GxqxJeIS4,8541
|
|
@@ -20,7 +20,7 @@ github_rest_api/scripts/github/create_pull_request.py,sha256=vmvZkQcQDjYHnECUW5q
|
|
|
20
20
|
github_rest_api/scripts/github/release_on_github.py,sha256=NWZIF6E76RWDVfyTUByupbRi3EWgJdLhqKF6g9rZo0o,4824
|
|
21
21
|
github_rest_api/scripts/github/remove_branch.py,sha256=iKZ4Y_lQlSOIfifC4plqP-B6pEMnFrknGMvV1oLnuLc,3538
|
|
22
22
|
github_rest_api/scripts/github/upload_image_to_issue.py,sha256=ccmRIjSFMLqnEZgT9gfVGiuqjtCKOmCw0prZ7qJhcbs,20744
|
|
23
|
-
github_rest_api-0.
|
|
24
|
-
github_rest_api-0.
|
|
25
|
-
github_rest_api-0.
|
|
26
|
-
github_rest_api-0.
|
|
23
|
+
github_rest_api-0.53.1.dist-info/METADATA,sha256=FLUiVee6-DJrNySMvhHOaH1Iy_6R_vvzU-YFjyZu-E4,913
|
|
24
|
+
github_rest_api-0.53.1.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
|
|
25
|
+
github_rest_api-0.53.1.dist-info/entry_points.txt,sha256=VPhTN8_eU6-3CnbygXBJRVDX9iEbhVhCeneoMfLZGKk,792
|
|
26
|
+
github_rest_api-0.53.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|