Skip to content

Conversation

@sethkfman
Copy link
Contributor

@sethkfman sethkfman commented Oct 28, 2025

Description

This PR enhances the format checking in CI to properly block unformatted code from being merged.

Changes:

  • Added format:check script for checking all files on the branch

Why:

The previous implementation only checked files in the last commit, which could allow unformatted code in earlier commits of a PR to slip through. This change ensures all files in the PR are checked.

CHANGELOG entry: null

Related issues

N/A

Manual testing steps

This change affects CI behavior. To test:

  1. Create a branch with unformatted code
  2. Push multiple commits
  3. Open a PR
  4. Verify that the format:check:changed job fails if any file is unformatted

Screenshots/Recordings

N/A - CI configuration change

Pre-merge author checklist

  • I've followed MetaMask Contributor Docs and MetaMask Mobile Coding Standards
  • I've completed the PR template to the best of my ability
  • I've included tests if applicable
  • I've documented my code using JSDoc format if applicable
  • I've applied the right labels on the PR (see labeling guidelines)
  • I've properly set the pull request status:
    • In case it's not yet ready for review, I've set it to "Draft"
    • In case it's ready for review, I've changed it from "Draft" to "Ready for review"

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed)
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots

Note

CI now runs yarn format:check across the repo; package.json formatting scripts updated to cover js/ts/tsx/json and add a full-repo check.

  • CI:
    • Replace format:check:changed with format:check in .github/workflows/ci.yml matrix to enforce full-repo formatting checks.
  • Scripts (package.json):
    • Add format:check script and use it in CI.
    • Update format/format:check globs to **/*.{js,ts,tsx,json}.
    • Adjust format:check:changed to match the same file set.

Written by Cursor Bugbot for commit 599b525. This will update automatically on new commits. Configure here.

- Update format:check:changed to check all files in PR (origin/main...HEAD) instead of just last commit (HEAD~1)
- Add format:check script for checking all files
- Update CI workflow to fetch full git history and main branch for proper comparison
- Ensures unformatted code is caught and blocks PR merges
@sethkfman sethkfman self-assigned this Oct 28, 2025
@github-actions
Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@metamaskbot metamaskbot added the team-mobile-platform Mobile Platform team label Oct 28, 2025
@sethkfman sethkfman marked this pull request as ready for review October 28, 2025 15:57
jake-perkins
jake-perkins previously approved these changes Oct 28, 2025
gambinish
gambinish previously approved these changes Oct 28, 2025
Copy link
Contributor

@gambinish gambinish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, I'll close mine ✅

vinnyhoward
vinnyhoward previously approved these changes Oct 28, 2025
weitingsun
weitingsun previously approved these changes Oct 28, 2025
Resolves parser error for .feature files in format:check
cursor[bot]

This comment was marked as outdated.

weitingsun
weitingsun previously approved these changes Oct 28, 2025
cursor[bot]

This comment was marked as outdated.

MarioAslau
MarioAslau previously approved these changes Oct 28, 2025
@joaoloureirop joaoloureirop requested review from a team as code owners October 28, 2025 22:53
@github-actions github-actions bot added size-XL and removed size-XS labels Oct 28, 2025
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
72.1% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

MarioAslau
MarioAslau previously approved these changes Oct 29, 2025
@sethkfman sethkfman added the DO-NOT-MERGE Pull requests that should not be merged label Oct 29, 2025
Copy link
Member

@Gudahtt Gudahtt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@Gudahtt Gudahtt merged commit 7167102 into main Oct 29, 2025
42 of 45 checks passed
@Gudahtt Gudahtt deleted the ci/block-unformatted-code branch October 29, 2025 20:02
@github-actions github-actions bot locked and limited conversation to collaborators Oct 29, 2025
@metamaskbot metamaskbot added the release-7.59.0 Issue or pull request that will be included in release 7.59.0 label Oct 29, 2025
@Gudahtt
Copy link
Member

Gudahtt commented Oct 29, 2025

Force-merge used because it was imperative to get this in before other PRs to prevent additional formatting errors on main

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

Labels

DO-NOT-MERGE Pull requests that should not be merged release-7.59.0 Issue or pull request that will be included in release 7.59.0 size-XS team-mobile-platform Mobile Platform team

Projects

None yet

Development

Successfully merging this pull request may close these issues.