Skip to content

Commit 83fa906

Browse files
committed
Biome 2
1 parent ec637aa commit 83fa906

File tree

2 files changed

+16
-14
lines changed

2 files changed

+16
-14
lines changed

plain-code/plain/code/biome.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
class Biome:
1919
"""Download, install, and invoke the Biome CLI standalone binary."""
2020

21+
TAG_PREFIX = "@biomejs/biome@"
22+
2123
@property
2224
def target_directory(self) -> str:
2325
# Directory under .plain to store the binary and lockfile
@@ -93,17 +95,16 @@ def download(self, version: str = "") -> str:
9395
# Build download URL based on version (tag: cli/vX.Y.Z) or latest
9496
slug = self.detect_platform_slug()
9597
if version:
96-
tag = version if version.startswith("v") else f"v{version}"
97-
release = f"cli/{tag}"
9898
url = (
99-
f"https://github.com/biomejs/biome/releases/download/{release}/"
99+
f"https://github.com/biomejs/biome/releases/download/{self.TAG_PREFIX}{version}/"
100100
f"biome-{slug}"
101101
)
102102
else:
103103
url = (
104104
f"https://github.com/biomejs/biome/releases/latest/download/"
105105
f"biome-{slug}"
106106
)
107+
107108
resp = requests.get(url, stream=True)
108109
resp.raise_for_status()
109110

@@ -134,12 +135,11 @@ def download(self, version: str = "") -> str:
134135
else:
135136
resolved = ""
136137
if resp.history:
137-
# Look for redirect to tag cli/vX.Y.Z
138+
# Look for redirect to actual tag version
138139
loc = resp.history[0].headers.get("Location", "")
139-
parts = loc.split("/")
140-
if "cli" in parts:
141-
idx = parts.index("cli")
142-
resolved = parts[idx + 1].lstrip("v")
140+
if self.TAG_PREFIX in loc:
141+
remaining = loc.split(self.TAG_PREFIX, 1)[-1]
142+
resolved = remaining.split("/")[0]
143143

144144
if not resolved:
145145
raise RuntimeError("Failed to determine resolved version from redirect")

plain-code/plain/code/biome_defaults.json

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
{
2+
"root": true,
23
"vcs": {
34
"enabled": true,
45
"clientKind": "git",
56
"useIgnoreFile": true
67
},
78
"files": {
8-
"ignore": [
9-
"**/vendor/**",
10-
"**/*.min.*",
11-
"**/tests/**",
12-
"**/htmlcov/**",
13-
"**/.venv/**"
9+
"includes": [
10+
"**",
11+
"!**/vendor/**",
12+
"!**/*.min.*",
13+
"!**/tests/**",
14+
"!**/htmlcov/**",
15+
"!**/.venv/**"
1416
]
1517
},
1618
"formatter": {

0 commit comments

Comments
 (0)