-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Consider adding package.json + prettier for contributing #106
Comments
I did try using something a while back, but the problem was managing PRs. I wanted to keep things easy for contributors, without them having to install and run stuff locally. This was before GitHub actions came about, so I could revisit this now, and have a style guide that runs when a PR is opened, maybe with issues being either auto-fixed, or added as a comment on the PR |
That makes perfect sense. Admittedly I've never used Prettier in a GitHub action to actually make changes, only to check and reject/accept PRs. It looks like the prettier-action can do all of that. Probably would be sensible (and marginally more performant) to use Something like: name: Continuous Integration
on:
pull_request:
branches: [master]
jobs:
prettier:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
fetch-depth: 0
- name: Prettify code
uses: creyD/[email protected]
with:
prettier_options: --write **/*.md *.md
only_changed: True |
Awesome, thanks for snippet. I'll try this out this evening and hopefully get a proper styleguide implemented :) |
I think it goes without saying that consistent and reproducible formatting on any project (especially one this popular) is always welcome.
I noticed in the
ATTRIBUTIONS.md
that you're (most likely) using a local installation of Prettier (<!-- prettier-ignore-start -->
). I think that adding a very minimal package.json with a pinned Prettier version included as a devDep could improve contributability(?).However, I've scanned the existing Markdown source with Prettier and there were quite a few recommendations for each file, so I'd be curious to know if you're using a customised config locally, or not using it at all (and the ignore tags I found are ancient relics)!
The text was updated successfully, but these errors were encountered: