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

feat: format built in command #657

Merged
merged 5 commits into from
Mar 12, 2024

Conversation

jessicatarra
Copy link
Contributor

Description

This PR introduces a new built-in command called "format" that follows the same implementation logic used in the development of the "analyze" command, which was merged in a previous (PR). The purpose of this change is to eliminate the need to set up a separate script in order to format each package.

For example, instead of using the following YAML configuration:

scripts:
  format:
    description: Format Dart code.
    run: dart format .

  format:check:
    description: Check formatting of Dart code.
    run: dart format --output none --set-exit-if-changed .

The first script can now be replaced with a simpler command: melos format. Similarly, the second script can be replaced with melos format --output none --set-exit-if-changed.

Additionally, this new command supports all melos filtering options and concurrency.

Dear maintainers, please feel free to review, modify, or add code to this contribution :)

Type of Change

  • feat -- New feature (non-breaking change which adds functionality)
  • 🛠️ fix -- Bug fix (non-breaking change which fixes an issue)
  • ! -- Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 refactor -- Code refactor
  • ci -- Build configuration change
  • 📝 docs -- Documentation
  • 🗑️ chore -- Chore

@CLAassistant
Copy link

CLAassistant commented Mar 12, 2024

CLA assistant check
All committers have signed the CLA.

@jessicatarra jessicatarra force-pushed the feature/format-built-in-command branch from 8ff7a82 to efbb4e9 Compare March 12, 2024 13:27
@jessicatarra jessicatarra force-pushed the feature/format-built-in-command branch from efbb4e9 to c7e2708 Compare March 12, 2024 13:36
Copy link
Collaborator

@spydon spydon left a comment

Choose a reason for hiding this comment

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

Two very minor comments, otherwise it looks good to me!

docs/commands/format.mdx Outdated Show resolved Hide resolved
Copy link
Collaborator

@spydon spydon left a comment

Choose a reason for hiding this comment

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

Looking forward to start using this!

@spydon spydon merged commit e0491f5 into invertase:main Mar 12, 2024
10 checks passed
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.

4 participants