Skip to content

[mojo-format] Add support for check subcommand - #6938

Closed
AmrDeveloper wants to merge 1 commit into
modular:mainfrom
AmrDeveloper:mojo_format_add_check_subcommand
Closed

AmrDeveloper wants to merge 1 commit into
modular:mainfrom
AmrDeveloper:mojo_format_add_check_subcommand

Conversation

@AmrDeveloper

Copy link
Copy Markdown

Linked issue

Fixes #6885

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • Performance improvement (includes benchmark results below)
  • Documentation update
  • New feature or public API (requires prior proposal or issue approval)
  • Refactor / internal cleanup (no user-visible change)
  • Build, CI, or tooling change

Motivation

Introduce a check subcommand without mutating the files, which can be easily used for the CI jobs.

What changed

Added a subcommand to the format command to perform a check only for the format without mutating the files, the actual change is to propagate the check action to mblack

Testing

Add a lit test that is expected to fail with unformatted Mojo code.

Checklist

  • The linked issue above has been reviewed by a maintainer and is
    agreed-upon, or this is a trivial fix that does not need prior
    approval
  • PR is small and focused — I've split larger changes into a sequence of
    smaller PRs where possible (see
    pull request sizes)
  • I ran ./bazelw run format to format my changes
  • I added or updated tests to cover my changes
  • If AI tools assisted with this contribution, I have included an
    Assisted-by: trailer in my commit message or this PR description (see
    AI Tool Use Policy)

@alisterburt

Copy link
Copy Markdown
Contributor

Hey @AmrDeveloper, love to see excitement for contributing to Mojo!

Unfortunately we're not ready to accept contributions in the KGEN directory just yet. For details please see this forum post.

I'm going to close this PR right now but please do keep checking back 🙂

@AmrDeveloper

Copy link
Copy Markdown
Author

Hey @alisterburt

Can we reopen the PR 🤔, I see in the forum that contributions is ready to be accepted

https://forum.modular.com/t/open-source-compiler-contributions/3423/4

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] Add non-mutating mojo format --check mode

2 participants