Skip to content

Add diff in output of --check (for CI use cases) #6885

@muescha

Description

@muescha

Edit 2025-03-06 by @lydell: This is a very long thread. It starts out with me asking for use cases for this feature. People then provide use cases over and over. It is clear that this is a wanted feature. There is no need to add more comments about that, but do react with 👍 on this post. There is a pull request #12598 for this feature, but it is (in my opinion) a bit lacking: #12598 (comment). I’m not a maintainer anymore, but it seems to me like a good PR for this would be merged.


More people submit PR for documents in Markdown files or other things via Github web editor. If they make a mistake then the CI fails but there is no chance to inform the user whats wrong.

I see some infos should be with the --debug-check but currently there is no output with this option.

Environments:

  • Prettier Version: 1.18.2
  • Running Prettier via: cli
  • Runtime: node?
  • Operating System: linux

Steps to reproduce:

prettier "**/*.{md,css,scss,yaml,yml,ts}" "--check"

Expected behavior:

Show each error and the changes like with --debug-check here in #4415

Actual behavior:

Show nothing about the errors:

> @ prettier /home/circleci/project
> prettier "**/*.{md,css,scss,yaml,yml,ts}" "--check"

Checking formatting...
docs/contributing/environment.md
Code style issues found in the above file(s). Forgot to run Prettier?

Also there are no more infos available with this commands:

prettier "**/*.{md,css,scss,yaml,yml,ts}" "--debug-check"
prettier "**/*.{md,css,scss,yaml,yml,ts}" "--debug-check" "--check"

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:cliIssues with Prettier's Command Line Interface

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions