-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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 link to reviewdog-action-prettier #12648
base: main
Are you sure you want to change the base?
Conversation
I'm not sure if we want add this link. If I understand correctly, this tool install Prettier from npm then run instead of running existing script in package.json. Personlly I don't like running Prettier in this way, it always running the latest version, and not easy to config options/patterns/ignore. We should not encourage people use Prettier in this way. (Just my own opinion.) |
Hi @fisker, first of all thank you for providing your opinion on this.
Not exactly. The action runs the following steps:
That's not exactly true. The action installs Prettier only if it cannot be found in the environment, and only if it's declared as a dependency in the I hope this better explains what this tool is about and how it interacts with the code formatter. Please let me know if you have any additional questions or doubts. :) |
Thanks for the explanation, I guess I was wrong. Have you considered just config one command? In our codebase the config will be like
|
Hi @fisker, thank you so much for your answer.
Yeah, actually this is something that I had setup within my CI prior to developing this action. Then I bumped into the reviewdog project and I was stunned by the rich features it provides when integrated with compatible CI/CD services. Just to provide additional context, the opening sentence from reviewdog's README better explains what the project is about:
Having a single command configured in In contrast, the main advantage of using reviewdog to run prettier and analyze its output (as reviewdog-action-prettier does) is that it provides rich code annotations and suggestions directly in the GitHub UI. Here are some screenshots which show how the output of this action looks within the GitHub Check report and PR UI respectively: You can also check out this sample PR to see a full example usage of this tool. I really enjoyed developing this GitHub action and I believe it could be extremely helpful for anyone trying to run prettier within their GitHub CI - as I'm currently doing in many of my repos. :) Please let me know if you have any additional questions or doubts, I'd be glad to answer. Thanks! |
We try to add similar tool before #9057 |
Hi @fisker, sorry for my late response. I can see that in the referenced PR you tried to implement some logic to auto fix code style issues. Anyway, I'd be glad to help in setting up the Code Analysis CI for this repository, if you'd like to. We could use several actions from the reviewdog ecosystem, depending on which checks should be implemented for the codebase. Please let me know what are your thoughts about it. :) Is any further action required from my side before merging this PR into Thank you for your precious time! |
https://github.com/creyD/prettier_action#usage, this is what I'm takings about, bad practice, I don't want define prettier version, patterns, flags again, we need something can run existing command. |
Nope, we need more review. |
Description
Hi there,
first of all I'd really like to thank you for such an amazing code formatter. It has proven to be life-saving for me - I'm using it in many of my open source projects and it has always helped me keeping my codebases clean and properly formatted! 🚀
I recently developed reviewdog-action-prettier, a project which allows to run Prettier as an action in GitHub Actions CI/CD workflows. The action is based on reviewdog and provides both code annotations and suggestions as GitHub checks. You can find the documentation, as well as several examples of the tool in action, on the project's repo.
This PR adds a link to reviewdog-action-prettier in the Related Projects section in Prettier docs website.
Thank you so much for your precious time, and keep up with the amazing work!
Checklist
docs/
directory).changelog_unreleased/*/XXXX.md
file followingchangelog_unreleased/TEMPLATE.md
.✨Try the playground for this PR✨