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

ci(prettier): add prettier check to Actions #2758

Merged
merged 3 commits into from
Sep 1, 2023
Merged

Conversation

ThatOneBro
Copy link
Member

@ThatOneBro ThatOneBro commented Aug 31, 2023

Background

Currently prettier runs as part of ESLint on the codebase but that is kind of slow and definitely slows feedback in your editor while coding and running ESLint in your editor simultaneously. We should also encourage devs to use prettier in their editor to auto-format and catch formatting issues before committing.

One way we can still catch prettier errors without running it in ESLint is to have an action that runs against PRs and catches any new prettier errors introduced in the new PR and report them via a comment. The comment will also mention how to fix it and even how to set up auto-formatting for newcomers or people who don't already have prettier setup in their editor.

What this PR does

  • Borrows Bun's prettier-fmt Github Action workflow and adapts it for Medplum's setup
  • Corrects existing prettier formatting issues throughout the codebase so that we can start from a clean slate

Next Steps

This synergizes with the changes in #2748 to remove prettier from the eslint config well and when that PR is merged we should see a slight decrease in time to ESLint feedback.

There also may be some debugging required to make sure this action is working. GitHub Action workflows are notoriously hard to debug so derrick/test-actions has been indicated in the new workflow as a branch to trigger this workflow on PR. The workflow can then be ensured working before we add it to PRs on main if we choose to go this route.

@ThatOneBro ThatOneBro requested a review from a team as a code owner August 31, 2023 17:37
@vercel
Copy link

vercel bot commented Aug 31, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Ignored Deployments
Name Status Preview Comments Updated (UTC)
medplum-storybook ⬜️ Ignored (Inspect) Visit Preview Aug 31, 2023 5:49pm
medplum-www ⬜️ Ignored (Inspect) Visit Preview Aug 31, 2023 5:49pm

@sonarcloud
Copy link

sonarcloud bot commented Aug 31, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@ThatOneBro ThatOneBro added this pull request to the merge queue Sep 1, 2023
Merged via the queue into main with commit 05ff3e0 Sep 1, 2023
11 checks passed
@ThatOneBro ThatOneBro deleted the add-prettier-to-actions branch September 1, 2023 18:10
codyebberson added a commit that referenced this pull request Sep 4, 2023
Agent installer performs silent upgrades (#2765)
Use Turborepo cache in Github Actions (#2766)
config(prettier): only run `prettier` on JS/TS-like files from CLI (#2767)
Fixes #2568 - move react native example into monorepo (#2742)
chore(ci): set `prettier` action to run on PR to `main`, fix format (#2764)
Fix typo: "Enpoint" -> "Endpoint" (#2763)
ci(prettier): add `prettier` check to Actions (#2758)
Document search implementation (#2750)
Bot logging fixes (#2743)
Update handling of AccessPolicy write criteria and add docs (#2720)
Allow search on name and address using stop word (#2749)
fix(ValueSet-expand): delete null `display` fields before resp (#2746)
Agent localhost testing documentation and examples (#2741)
Add repeatable items and groups to Questionnaire (#2690)
github-merge-queue bot pushed a commit that referenced this pull request Sep 5, 2023
Agent installer performs silent upgrades (#2765)
Use Turborepo cache in Github Actions (#2766)
config(prettier): only run `prettier` on JS/TS-like files from CLI (#2767)
Fixes #2568 - move react native example into monorepo (#2742)
chore(ci): set `prettier` action to run on PR to `main`, fix format (#2764)
Fix typo: "Enpoint" -> "Endpoint" (#2763)
ci(prettier): add `prettier` check to Actions (#2758)
Document search implementation (#2750)
Bot logging fixes (#2743)
Update handling of AccessPolicy write criteria and add docs (#2720)
Allow search on name and address using stop word (#2749)
fix(ValueSet-expand): delete null `display` fields before resp (#2746)
Agent localhost testing documentation and examples (#2741)
Add repeatable items and groups to Questionnaire (#2690)
@reshmakh reshmakh added this to the September 15, 2023 milestone Sep 6, 2023
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.

None yet

3 participants