Skip to content

Commit 2e8e588

Browse files
grstZethson
andauthored
Apply suggestions from code review
Co-authored-by: Lukas Heumos <lukas.heumos@posteo.net>
1 parent a188a5b commit 2e8e588

3 files changed

Lines changed: 8 additions & 12 deletions

File tree

.github/workflows/make-json.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
uses: astral-sh/setup-uv@v7
2121
with:
2222
cache-dependency-glob: scripts/pyproject.toml
23-
- name: Excecute validation script and create output directory
23+
- name: Execute validation script and create output directory
2424
run: |
2525
uvx --from ./scripts validate-registry --registry-dir packages --outdir=build
2626
env:

scripts/src/ecosystem_scripts/schema.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@
207207
"type": "string"
208208
},
209209
"contact": {
210-
"description": "Point of contact for this package. This does not need to be the full list of maintainers, but whoever feels responsible for this metadata entry and serves as a point of contact for scverse. Entries must be Github user IDs.",
210+
"description": "Point of contact for this package. Does not need to be the full list of maintainers. Entries must be Github user IDs.",
211211
"type": "array",
212212
"items": {
213213
"type": "string"
@@ -216,7 +216,7 @@
216216
"uniqueItems": true
217217
},
218218
"logo": {
219-
"description": "Path to the logo (relative to meta.yaml). Should be either logo.png, logo.webp, or logo.svg. In case of a PNG image, it must fit in a bounding box of 512x512px and one dimention must be exactly 512px.",
219+
"description": "Path to the logo (relative to meta.yaml). Should be either logo.png, logo.webp, or logo.svg. In case of a PNG image, it must fit in a bounding box of 512x512px and one dimension must be exactly 512px.",
220220
"type": "string",
221221
"pattern": "logo\\.(svg|png|webp)"
222222
},

scripts/src/ecosystem_scripts/validate_registry.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env python
2-
"""Valididate packages' meta.yaml and generate an output directory with json/images to be uploaded on github pages"""
2+
"""Validate packages' meta.yaml and generate an output directory with json/images to be uploaded on Github Pages"""
33

44
from __future__ import annotations
55

@@ -63,7 +63,7 @@ def check_and_register(self, url: str, context: str) -> None:
6363

6464

6565
class GitHubUserValidator:
66-
"""Validate GitHub usernames against the GitHub API."""
66+
"""Validate GitHub usernames using the GitHub API."""
6767

6868
def __init__(self, github_token: str | None = None):
6969
self.github_token = github_token
@@ -79,7 +79,6 @@ def validate_username(self, username: str, context: str) -> None:
7979
context
8080
Context information for error messages (e.g., file being validated)
8181
"""
82-
# Skip if already validated
8382
if username in self.validated_users:
8483
return
8584

@@ -116,7 +115,6 @@ def validate_package(self, package_name: str, context: str) -> None:
116115
context
117116
Context information for error messages (e.g., file being validated)
118117
"""
119-
# Skip if already validated
120118
if package_name in self.validated_packages:
121119
return
122120

@@ -134,7 +132,7 @@ def validate_package(self, package_name: str, context: str) -> None:
134132

135133

136134
class CondaValidator:
137-
"""Validate Conda package identifiers against the Anaconda API."""
135+
"""Validate Conda package identifiers using the Anaconda API."""
138136

139137
def __init__(self):
140138
self.validated_packages: set[str] = set()
@@ -149,7 +147,6 @@ def validate_package(self, package_spec: str, context: str) -> None:
149147
context
150148
Context information for error messages (e.g., file being validated)
151149
"""
152-
# Skip if already validated
153150
if package_spec in self.validated_packages:
154151
return
155152

@@ -178,7 +175,7 @@ def validate_package(self, package_spec: str, context: str) -> None:
178175

179176

180177
class CRANValidator:
181-
"""Validate CRAN package names against the CRAN API."""
178+
"""Validate CRAN package names using the CRAN API."""
182179

183180
def __init__(self):
184181
self.validated_packages: set[str] = set()
@@ -193,7 +190,6 @@ def validate_package(self, package_name: str, context: str) -> None:
193190
context
194191
Context information for error messages (e.g., file being validated)
195192
"""
196-
# Skip if already validated
197193
if package_name in self.validated_packages:
198194
return
199195

@@ -215,7 +211,7 @@ def validate_package(self, package_name: str, context: str) -> None:
215211

216212

217213
def _check_image(img_path: Path) -> None:
218-
"""Check that the image exists and that it is either SVG or fits into the 512x512 bounding box."""
214+
"""Validates that the image exists and that it is either a SVG or fits into the 512x512 bounding box."""
219215
if not img_path.exists():
220216
msg = f"Image does not exist: {img_path}"
221217
raise ValueError(msg)

0 commit comments

Comments
 (0)