Skip to content

Add CI lint for JSON test fixture formatting#1286

Draft
jkmassel wants to merge 2 commits into
trunkfrom
jkmassel/lint-json-fixtures
Draft

Add CI lint for JSON test fixture formatting#1286
jkmassel wants to merge 2 commits into
trunkfrom
jkmassel/lint-json-fixtures

Conversation

@jkmassel
Copy link
Copy Markdown
Contributor

Description

Adds a CI lint that validates all JSON test fixtures are consistently pretty-printed, and reformats existing fixtures to match.

Changes

  • scripts/check-json-formatting.sh: jq-based check/fix script for JSON fixture formatting (2-space indent, no BOM)
  • Makefile: fmt-check-json (lint) and fmt-json (auto-fix) targets; fmt-check-json added to the lint meta-target
  • .buildkite/pipeline.yml: Added the check to the :rust: Lint step
  • Reformatted all 118 existing JSON fixtures to jq . output — pure formatting, no content changes

Test plan

  • make fmt-check-json passes locally
  • make fmt-json fixes intentionally-broken fixtures
  • Unit tests pass after reformatting (cargo test --lib)
  • Buildkite :rust: Lint step passes

Adds a `jq`-based check that all JSON test fixtures in `wp_api/tests/`
and `test-data/` are pretty-printed with consistent 2-space indent.

- `make fmt-check-json` — fails if any fixture isn't properly formatted
- `make fmt-json` — auto-fixes all fixtures in place
- Added to the `:rust: Lint` step in the Buildkite pipeline
Standardizes all JSON test fixtures to `jq .` output (2-space indent,
no trailing whitespace, no BOM). This is a pure formatting change — no
content was modified.
@wpmobilebot
Copy link
Copy Markdown
Collaborator

XCFramework Build

This PR's XCFramework is available for testing. Add to your Package.swift:

.package(url: "https://github.com/automattic/wordpress-rs", branch: "pr-build/1286")

Built from f7bfb89

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants