Skip to content

Commit 858a59a

Browse files
committed
style(fmt[markdown]): Format Python blocks in Markdown
why: ruff 0.16.0 formats Python and pycon code blocks inside Markdown by default, so `ruff format . --check` now fails on docs that were never run through the formatter. The churn is mechanical - quote style, argument wrapping, comment spacing, trailing whitespace. what: - Reformat the Python blocks in `README.md` - Reformat the Python blocks in `notes/2025-11-26-command-support.md` https://astral.sh/blog/ruff-v0.16.0
1 parent 0f8684d commit 858a59a

2 files changed

Lines changed: 26 additions & 30 deletions

File tree

README.md

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,7 @@ from libvcs.sync.git import GitSync
6464
repo = GitSync(
6565
url="https://github.com/vcs-python/libvcs",
6666
path=pathlib.Path.cwd() / "libvcs",
67-
remotes={
68-
'gitlab': 'https://gitlab.com/vcs-python/libvcs'
69-
}
67+
remotes={"gitlab": "https://gitlab.com/vcs-python/libvcs"},
7068
)
7169

7270
# Clone (if not exists) or fetch & update (if exists)
@@ -89,19 +87,19 @@ import pathlib
8987
from libvcs.cmd.git import Git
9088

9189
# Initialize the wrapper
92-
git = Git(path=pathlib.Path.cwd() / 'libvcs')
90+
git = Git(path=pathlib.Path.cwd() / "libvcs")
9391

9492
# Run commands directly
95-
git.clone(url='https://github.com/vcs-python/libvcs.git')
96-
git.checkout(ref='master')
93+
git.clone(url="https://github.com/vcs-python/libvcs.git")
94+
git.checkout(ref="master")
9795

9896
# Traverse branches with ORM-like filtering
99-
git.branches.create('feature/new-gui')
97+
git.branches.create("feature/new-gui")
10098
print(git.branches.ls()) # Returns QueryList for filtering
10199

102100
# Target specific entities with contextual commands
103-
git.remotes.set_url(name='origin', url='git@github.com:vcs-python/libvcs.git')
104-
git.tags.create(name='v1.0.0', message='Release version 1.0.0')
101+
git.remotes.set_url(name="origin", url="git@github.com:vcs-python/libvcs.git")
102+
git.tags.create(name="v1.0.0", message="Release version 1.0.0")
105103
```
106104

107105
### 3. URL Parsing
@@ -113,17 +111,17 @@ Stop writing regex for Git URLs. Let `libvcs` handle the edge cases.
113111
from libvcs.url.git import GitURL
114112

115113
# Validate URLs
116-
GitURL.is_valid(url='https://github.com/vcs-python/libvcs.git') # True
114+
GitURL.is_valid(url="https://github.com/vcs-python/libvcs.git") # True
117115

118116
# Parse complex URLs
119-
url = GitURL(url='git@github.com:vcs-python/libvcs.git')
117+
url = GitURL(url="git@github.com:vcs-python/libvcs.git")
120118

121-
print(url.user) # 'git'
119+
print(url.user) # 'git'
122120
print(url.hostname) # 'github.com'
123-
print(url.path) # 'vcs-python/libvcs'
121+
print(url.path) # 'vcs-python/libvcs'
124122

125123
# Transform URLs
126-
url.hostname = 'gitlab.com'
124+
url.hostname = "gitlab.com"
127125
print(url.to_url()) # 'git@gitlab.com:vcs-python/libvcs.git'
128126
```
129127

@@ -137,18 +135,16 @@ import pathlib
137135
from libvcs.pytest_plugin import CreateRepoFn
138136
from libvcs.sync.git import GitSync
139137

140-
def test_my_git_tool(
141-
create_git_remote_repo: CreateRepoFn,
142-
tmp_path: pathlib.Path
143-
):
138+
139+
def test_my_git_tool(create_git_remote_repo: CreateRepoFn, tmp_path: pathlib.Path):
144140
# Spin up a real, temporary Git server
145141
git_server = create_git_remote_repo()
146-
142+
147143
# Clone it to a temporary directory
148144
checkout_path = tmp_path / "checkout"
149145
repo = GitSync(path=checkout_path, url=f"file://{git_server}")
150146
repo.obtain()
151-
147+
152148
assert checkout_path.exists()
153149
assert (checkout_path / ".git").is_dir()
154150
```

notes/2025-11-26-command-support.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -558,23 +558,23 @@ reflog_pattern = r"(?P<sha>[a-f0-9]+) (?P<ref>[^@]+)@\{(?P<index>\d+)\}: (?P<act
558558
```python
559559
class Git:
560560
submodule: GitSubmoduleCmd
561-
remotes: GitRemoteManager # ✓ Manager pattern
561+
remotes: GitRemoteManager # ✓ Manager pattern
562562
stash: GitStashCmd
563-
branches: GitBranchManager # ✓ Manager pattern
563+
branches: GitBranchManager # ✓ Manager pattern
564564
```
565565

566566
### Planned
567567

568568
```python
569569
class Git:
570-
submodules: GitSubmoduleManager # Renamed + Manager pattern
571-
remotes: GitRemoteManager # ✓ Already done
572-
stash: GitStashManager # Refactored to Manager pattern
573-
branches: GitBranchManager # ✓ Already done
574-
tags: GitTagManager # New
575-
worktrees: GitWorktreeManager # New
576-
notes: GitNotesManager # New
577-
reflog: GitReflogManager # New
570+
submodules: GitSubmoduleManager # Renamed + Manager pattern
571+
remotes: GitRemoteManager # ✓ Already done
572+
stash: GitStashManager # Refactored to Manager pattern
573+
branches: GitBranchManager # ✓ Already done
574+
tags: GitTagManager # New
575+
worktrees: GitWorktreeManager # New
576+
notes: GitNotesManager # New
577+
reflog: GitReflogManager # New
578578
```
579579

580580
---

0 commit comments

Comments
 (0)