Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add grit format command to Grit CLI #580

Closed
wants to merge 2 commits into from

Conversation

vishwamartur
Copy link

@vishwamartur vishwamartur commented Nov 18, 2024

Related to #574

Add grit format command to the Grit CLI.

  • Implement the grit format command in crates/cli/src/commands/format.rs using the Biome crate for formatting.
  • Add logic to look for all grit patterns in the current directory, including .yaml, .grit files, and markdown patterns.
  • Implement the --write flag to write the re-formatted patterns back if provided.
  • Extract gritql from markdown files and format the extracted gritql.
  • Update crates/cli/src/commands/mod.rs to include the format module and the Format variant in the Commands enum.
  • Add a CLI test case for the grit format command in crates/cli_bin/tests/format.rs.

/claim #574

Related to getgrit#574

Add `grit format` command to the Grit CLI.

* Implement the `grit format` command in `crates/cli/src/commands/format.rs` using the Biome crate for formatting.
* Add logic to look for all grit patterns in the current directory, including `.yaml`, `.grit` files, and markdown patterns.
* Implement the `--write` flag to write the re-formatted patterns back if provided.
* Extract gritql from markdown files and format the extracted gritql.
* Update `crates/cli/src/commands/mod.rs` to include the `format` module and the `Format` variant in the `Commands` enum.
* Add a CLI test case for the `grit format` command in `crates/cli_bin/tests/format.rs`.
@vishwamartur vishwamartur requested a review from a team as a code owner November 18, 2024 08:47
@algora-pbc algora-pbc bot mentioned this pull request Nov 18, 2024
Copy link

algora-pbc bot commented Nov 18, 2024

💵 To receive payouts, sign up on Algora, link your Github account and connect with Stripe.

Copy link
Contributor

@morgante morgante left a comment

Choose a reason for hiding this comment

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

I don't see any actual format code implementation...

…ing.

* Add logic to look for all grit patterns in the current directory.
* Implement the `--write` flag to write the re-formatted patterns back.
* Extract gritql from markdown files and format the extracted gritql.
* Add the `format` module to the list of subcommands.
* Update the `Commands` enum to include the `Format` variant.
* Add at least one CLI test case for the `grit format` command.
@morgante
Copy link
Contributor

morgante commented Dec 3, 2024

Closing. Feel free to reopen if you have code.

@morgante morgante closed this Dec 3, 2024
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.

2 participants