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 --check and --format actions #785

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Add --check and --format actions #785

wants to merge 1 commit into from

Conversation

MrJohz
Copy link

@MrJohz MrJohz commented Sep 23, 2024

Adds the --check flag, which returns an error if the input is incorrectly formatted, or 0 otherwise.

If the --check flag is not present, or if the --format flag is specified, then prettierd reverts to the default behaviour of formatting the flag.

If both flags are specified, the last one wins (i.e. --check --format will format the document).

This resolves #784, and makes it possible to use prettierd as a linter, e.g. in precommit hooks or similar situations.

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.

Add a --check flag or check command that only prints out whether the file is correctly formatted or not
1 participant