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

chore(repo): Enforce prettier on CI #941

Merged
merged 7 commits into from
Jul 15, 2021
Merged

chore(repo): Enforce prettier on CI #941

merged 7 commits into from
Jul 15, 2021

Conversation

tjenkinson
Copy link
Member

Rollup Plugin Name: na

This PR contains:

  • bugfix
  • feature
  • refactor
  • documentation
  • other

Are tests included?

  • yes (bugfixes and features will not be merged without tests)
  • no

Breaking Changes?

  • yes (breaking changes will not be merged unless absolutely necessary)
  • no

List any relevant issue numbers: #787

Description

Some changes that were in #787 and missed in the version in master.

At the moment on CI prettier is run with --write, meaning I think any error would not cause an issue because the files would also be 'fixed' on CI.

With this PR we now enforce that prettier has been run on the files as they are in git, and also on every file type that prettier understands.

It also adds a few more extensions to the precommit hook, and removes the --plugin flag because it shouldn't be needed given the plugin is listed in the config file :)

lennyburdette and others added 5 commits July 15, 2021 16:06
Allow dynamically importing files in the same directory with an extra suffix before the extension.
and do not pass `--single-quote` to use the value in the config
because it will be loaded automatically given it's in the config
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your PR title doesn't match the required format. The title should be in the conventional commit (https://www.conventionalcommits.org/en/v1.0.0-beta.4/) format. e.g.

chore(plugin-name): add pr title workflow

@tjenkinson tjenkinson changed the title Enforce prettier on CI chore(repo): Enforce prettier on CI Jul 15, 2021
@tjenkinson tjenkinson marked this pull request as ready for review July 15, 2021 20:40
@shellscape shellscape force-pushed the master branch 2 times, most recently from c33e948 to 1ae22f4 Compare July 15, 2021 21:28
@shellscape
Copy link
Collaborator

Thanks for opening this one! Very sorry I missed that. As soon as CI is done we'll merge.

@shellscape
Copy link
Collaborator

shellscape commented Jul 15, 2021

OK so we're getting a weird one:

> @rollup/plugins@ prettier:check /Users/powella/code/rollup/plugins
> prettier --check .

Checking formatting...
[warn] packages/dynamic-import-vars/CHANGELOG.md
[warn] Code style issues found in the above file(s). Forgot to run Prettier?

I can reproduce this locally. However, when I run pnpm lint:docs the file doesn't change. When I run npx prettier --write packages/dynamic-import-vars/CHANGELOG.md, the file changes. Super weird.

Diff looks like this:

diff --git a/packages/dynamic-import-vars/CHANGELOG.md b/packages/dynamic-import-vars/CHANGELOG.md
index f8e17bf..219d285 100644
--- a/packages/dynamic-import-vars/CHANGELOG.md
+++ b/packages/dynamic-import-vars/CHANGELOG.md
@@ -69,4 +69,4 @@ _2020-08-13_
 
 _2020-07-06_
 
-- First release
\ No newline at end of file
+- First release

Got it. CHANGELOG files weren't in the glob.

@shellscape shellscape merged commit ceb882f into master Jul 15, 2021
@shellscape shellscape deleted the enforce-prettier branch July 15, 2021 21:46
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.

3 participants