Skip to content

Commit 3b9d03d

Browse files
authored
Fix misspellings flagged by Optional Lint (misspell check) (microsoft#2515)
The "Optional Lint" CI job was failing due to British English spellings detected by the `misspell` checker. Corrected all flagged occurrences across four files: - **`olive/cli/model_package.py`** — `behaviour` → `behavior` (×5), `recognised` → `recognized` (×1) - **`mcp/src/olive_mcp/jobs.py`** — `cancelled` → `canceled` (×2, includes a status string value used in comparisons) - **`mcp/src/olive_mcp/tools.py`** — `cancelled` → `canceled` (×6, includes status string values and log messages) - **`test/cli/test_model_package.py`** — `honour` → `honor` (×1), `recognises` → `recognizes` (×1) ## Checklist before requesting a review - [ ] Add unit tests for this change. - [x] Make sure all tests can pass. - [ ] Update documents if necessary. - [x] Lint and apply fixes to your code by running `lintrunner -a` - [ ] Is this a user-facing change? If yes, give a description of this change to be included in the release notes. ## (Optional) Issue link --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
1 parent de3d719 commit 3b9d03d

4 files changed

Lines changed: 14 additions & 14 deletions

File tree

mcp/src/olive_mcp/jobs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,8 @@ async def _run_olive_background(
173173
await proc.wait()
174174
stdout_str = stdout_bytes.decode("utf-8", errors="replace")
175175

176-
# If the job was already cancelled, don't overwrite its status.
177-
if _jobs[job_id]["status"] == "cancelled":
176+
# If the job was already canceled, don't overwrite its status.
177+
if _jobs[job_id]["status"] == "canceled":
178178
return
179179

180180
if proc.returncode != 0:

mcp/src/olive_mcp/tools.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -227,11 +227,11 @@ async def cancel_job(job_id: str) -> dict:
227227
_sp.call(["taskkill", "/F", "/T", "/PID", str(proc.pid)], stdout=_sp.DEVNULL, stderr=_sp.DEVNULL)
228228
else:
229229
proc.terminate()
230-
_job_log(job_id, "Job cancelled by user")
230+
_job_log(job_id, "Job canceled by user")
231231

232-
job["status"] = "cancelled"
233-
job["result"] = {"status": "cancelled", "message": "Job was cancelled by user."}
234-
return {"status": "cancelled", "job_id": job_id, "message": "Job cancelled."}
232+
job["status"] = "canceled"
233+
job["result"] = {"status": "canceled", "message": "Job was canceled by user."}
234+
return {"status": "canceled", "job_id": job_id, "message": "Job canceled."}
235235

236236

237237
@mcp.tool()

olive/cli/model_package.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ def _collect_config_files(targets: list[tuple[str, Path, dict]]) -> dict[str, Pa
286286
config set.
287287
288288
Subdirectories that hold model artifacts (e.g. Mobius VLM's
289-
``decoder/``, ``embedding/``, ``vision_encoder/``, recognised via
289+
``decoder/``, ``embedding/``, ``vision_encoder/``, recognized via
290290
the ``model.<role>.filename`` references in the source's
291291
``genai_config.json``) are excluded from this sweep — they're
292292
copied per-variant into ``models/<component>/<variant>/`` and have
@@ -442,7 +442,7 @@ def _variant_artifacts(v: VariantSpec) -> list[OnnxArtifact]:
442442
443443
When ``onnx_rel_paths`` is empty (legacy callers), the rel path defaults
444444
to each source file's basename, preserving the original flat-layout
445-
behaviour. When supplied (the CLI's genai_config-driven path), the rel
445+
behavior. When supplied (the CLI's genai_config-driven path), the rel
446446
path is used verbatim so multi-component sources land in matching
447447
subdirectories under the variant dir.
448448
"""
@@ -556,7 +556,7 @@ def _assign_role(role: str, component: str) -> None:
556556
_assign_role(role_name, v.component_name)
557557
# Fallback for components whose variants carried no usable source_genai:
558558
# map the component name to itself as the role, matching the legacy
559-
# writer behaviour for direct ``write_model_package`` callers.
559+
# writer behavior for direct ``write_model_package`` callers.
560560
for comp_name in components:
561561
explicit_role = component_to_role.get(comp_name, comp_name)
562562
if explicit_role not in role_to_component:
@@ -693,10 +693,10 @@ def _copy_with_collision_check(src: Path, dst: Path, *, skip_if_identical: bool
693693
than choose a winner: silently keeping either copy could leave the
694694
package referencing a stale or wrong blob. ``skip_if_identical`` is
695695
accepted as an explicit-intent flag at the call site (the dedupe
696-
behaviour is always on; the flag exists so the sidecar sweep reads
696+
behavior is always on; the flag exists so the sidecar sweep reads
697697
self-documenting).
698698
"""
699-
del skip_if_identical # behaviour is always content-aware; flag is documentation
699+
del skip_if_identical # behavior is always content-aware; flag is documentation
700700
if dst.exists():
701701
if not dst.is_file():
702702
raise FileExistsError(f"Cannot copy {src} to {dst}: destination exists and is not a regular file.")
@@ -886,7 +886,7 @@ def _lift_role_overlay_body(role_body: dict, onnx_rel_paths: Optional[list[str]]
886886
has_pipeline = isinstance(pipeline, list) and pipeline
887887
filename = role_body.get("filename")
888888
# ``pipeline`` takes precedence when both are present (mirrors the
889-
# behaviour of ``_collect_artifacts_per_role``, which only emits
889+
# behavior of ``_collect_artifacts_per_role``, which only emits
890890
# pipeline stage artifacts in that case). Lifting both would produce
891891
# an overlay with both ``filename`` and ``pipeline`` (malformed for the
892892
# loader) and reuse ``onnx_rel_paths[0]`` — which is stage 0's

test/cli/test_model_package.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ def test_base_genai_strips_per_variant_model_fields(self, tmp_path):
548548
"""The base ``configs/genai_config.json`` must not carry per-variant fields.
549549
550550
If ``context_length`` (or similar) lived in the base, GenAI's overlay
551-
merge would still honour the per-variant value (overlay scalar wins),
551+
merge would still honor the per-variant value (overlay scalar wins),
552552
but ``_VARIANT_LEVEL_MODEL_KEYS`` includes arrays (``eos_token_id``)
553553
whose presence in the base would trigger GenAI's array-append merge
554554
semantics — the merged result would duplicate the array. So the base
@@ -1521,7 +1521,7 @@ def test_configs_dir_excludes_model_artifact_subdirs(self, tmp_path):
15211521
Without explicit exclusion the config-file sweep would copy every
15221522
source-root directory (including the model-artifact subdirs), so the
15231523
package would carry duplicate ONNXs under ``configs/`` and bloat
1524-
the deliverable. The sweep recognises model-artifact subdirs via
1524+
the deliverable. The sweep recognizes model-artifact subdirs via
15251525
the genai_config's role filenames and skips them.
15261526
"""
15271527
src = _create_mobius_vlm_source(tmp_path, "cpu")

0 commit comments

Comments
 (0)