Skip to content

Commit a80e43a

Browse files
flying-sheepCopilot
andcommitted
use context
Co-authored-by: Copilot <copilot@github.com>
1 parent d6c1eca commit a80e43a

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

scripts/src/ecosystem_scripts/validate_registry.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,15 @@ async def __call__(self, url: str, context: str) -> None | ValidationError:
8686
try:
8787
response = await self.client.head(url)
8888
except Exception as e:
89-
msg = f"URL {url} is not reachable: {e}"
89+
msg = f"{context}: URL {url} is not reachable: {e}"
9090
return ValidationError(msg)
9191

9292
if response.status_code != httpx.codes.OK:
93-
msg = f"URL {url} is not reachable (error {response.status_code}). "
93+
msg = f"{context}: URL {url} is not reachable (error {response.status_code}). "
9494
return ValidationError(msg)
9595

9696
self.validated.add(url)
97+
log.info(f"Validated URL for {context}: {url!r}")
9798
return None
9899

99100

@@ -142,7 +143,7 @@ async def __call__(self, usernames: Sequence[str], context: str) -> None | Valid
142143
return ValidationError(msg)
143144

144145
self.validated |= set(unvalidated)
145-
log.info(f"Validated GitHub users: {unvalidated!r}")
146+
log.info(f"Validated GitHub users for {context}: {unvalidated!r}")
146147
return None
147148

148149

@@ -177,7 +178,7 @@ async def __call__(self, package_name: str, context: str) -> None | ValidationEr
177178
return ValidationError(msg)
178179

179180
self.validated.add(package_name)
180-
log.info(f"Validated PyPI package: {package_name}")
181+
log.info(f"Validated PyPI package for {context}: {package_name}")
181182
return None
182183

183184

@@ -220,7 +221,7 @@ async def __call__(self, package_spec: str, context: str) -> None | ValidationEr
220221
return ValidationError(msg)
221222

222223
self.validated.add(package_spec)
223-
log.info(f"Validated Conda package: {package_spec}")
224+
log.info(f"Validated Conda package for {context}: {package_spec}")
224225
return None
225226

226227

@@ -256,7 +257,7 @@ async def __call__(self, package_name: str, context: str) -> None | ValidationEr
256257
return ValidationError(msg)
257258

258259
self.validated.add(package_name)
259-
log.info(f"Validated CRAN package: {package_name}")
260+
log.info(f"Validated CRAN package for {context}: {package_name}")
260261
return None
261262

262263

@@ -292,7 +293,7 @@ async def __call__(self, package_name: str, context: str) -> None | ValidationEr
292293
return ValidationError(msg)
293294

294295
self.validated.add(package_name)
295-
log.info(f"Validated Bioconductor package: {package_name}")
296+
log.info(f"Validated Bioconductor package for {context}: {package_name}")
296297
return None
297298

298299

0 commit comments

Comments
 (0)