Skip to content

Rename internal canonicalise identifiers to Oxford -ize spelling #408

Description

@lodyai

Summary

Several of netsuke's own identifiers, localization key constants, and Fluent
message IDs spell "canonicalise" with the British -ise ending. Per the project
convention, identifiers should use en-GB-oxendict (Oxford -ize) spelling unless
they reference an external API. These are internal names, so they should be
canonicalize.

The rest of the codebase already follows this — the cycle module, hasher, and
runner::process::paths all use canonicalize, and the external
std::fs::canonicalize call is (correctly) spelled -ize. The stdlib::which
and stdlib::path modules are the outliers.

This was surfaced while adding the typos spelling gate (#407): references to
canonicalise in the docs had to be wrapped in backticks precisely because they
name these real identifiers. Renaming the identifiers is the proper fix; the doc
backticks can then be removed.

Affected identifiers (internal — should become -ize)

Enum variants and helpers in the which resolver:

  • src/stdlib/which/resolve_error.rs: ResolveError::Canonicalise,
    ResolveError::CanonicaliseNonUtf8, and their string discriminants
    "canonicalise" / "canonicalise_non_utf8"
  • src/stdlib/which/lookup/mod.rs: pub(super) fn canonicalise(...) and its
    call sites (lines 65, 96, 113, 234)
  • src/stdlib/which/mod.rs: fn canonicalise_message(...) and the match arms
    over the renamed variants

Localization key constants in src/localization/keys.rs:

  • STDLIB_PATH_ACTION_CANONICALISE
  • STDLIB_WHICH_CANONICALISE_FAILED
  • STDLIB_WHICH_CANONICALISE_NON_UTF8

Fluent message IDs (the string values of those constants), which must be renamed
in lockstep across every locale or the build-time l10n audit
(build_l10n_audit.rs) will fail:

  • stdlib.path.action.canonicalise
  • stdlib.which.canonicalise_failed
  • stdlib.which.canonicalise_non_utf8
  • Files: locales/en-US/messages.ftl, locales/es-ES/messages.ftl

Tests and doc comments:

  • tests/std_filter_tests/which_filter_tests.rs: test name
    which_filter_all_with_duplicates_deduplicates_canonicalised_paths
  • Doc comments in src/runner/process/paths.rs,
    src/stdlib/which/lookup/mod.rs, and src/stdlib/path/path_utils.rs
  • The context string "canonicalise stdlib cache URL" in
    tests/bdd/steps/stdlib/assertions.rs

Explicitly out of scope (keep as-is)

  • std::fs::canonicalize (src/stdlib/which/lookup/mod.rs:264) — external API,
    already -ize.

Suggested acceptance criteria

  • All internal canonicalise/Canonicalise identifiers renamed to the
    Oxford -ize spelling.
  • The three localization key constants and their Fluent message IDs renamed
    in lockstep across keys.rs, locales/en-US/messages.ftl, and
    locales/es-ES/messages.ftl, with make test / the build-time l10n audit
    green.
  • Doc-comment and test-name occurrences updated.
  • Doc references to canonicalise that were backticked in Enforce en-GB-oxendict spelling with typos #407 (for
    example in
    docs/execplans/3-14-4-command-available-non-throwing-executable-probe.md)
    updated to the new identifier where they name the code.
  • make check-fmt, make lint, make test, and make markdownlint pass.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationrefactor

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions