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: on commit format changed files with prettier #9128

Conversation

iamandrewluca
Copy link
Contributor

@iamandrewluca iamandrewluca commented May 2, 2024

It needs to be clarified which format style guide to use in the project.
I added the prettier format for only changed files using the default config.
I did not run prettier on the entire project, as there are a lot of files (over 1k) to be changed.

Did some tests and changed a little default prettier config, to match more the formatting of current source code.

git st
On branch chore/add-prettier-format-on-commit
Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
	new file:   .husky/pre-commit
	modified:   package.json
	modified:   pnpm-lock.yaml
	modified:   tests/test-projects/live-reloading/schemas/syntax-error.js

git ci -m "chore: on commit format changed files with prettier"

> @keystone-6/mono-repo@0.0.0 npx
> lint-staged

✔ Preparing lint-staged...
✔ Running tasks for staged files...
✔ Applying modifications from tasks...
✔ Cleaning up temporary files...
[chore/add-prettier-format-on-commit a50423f97] chore: on commit format changed files with prettier
 4 files changed, 15295 insertions(+), 8241 deletions(-)
 create mode 100644 .husky/pre-commit

@iamandrewluca iamandrewluca force-pushed the chore/add-prettier-format-on-commit branch 4 times, most recently from 2385280 to 10701bf Compare May 2, 2024 18:54
Copy link

codesandbox-ci bot commented May 2, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 61d8db8:

Sandbox Source
@keystone-6/sandbox Configuration

@iamandrewluca iamandrewluca force-pushed the chore/add-prettier-format-on-commit branch from 10701bf to 0e19844 Compare May 2, 2024 19:02
@iamandrewluca iamandrewluca force-pushed the chore/add-prettier-format-on-commit branch from 94e1567 to 8d18a1d Compare May 4, 2024 10:58
@@ -16,7 +16,7 @@
"test:debug": "node --inspect-brk ./node_modules/.bin/jest",
"test:admin-ui": "jest tests/admin-ui-tests",
"build": "preconstruct build",
"prepare": "preconstruct dev"
Copy link
Member

Choose a reason for hiding this comment

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

I am personally against using husky or anything that hooks into my git workflows

"singleQuote": true,
"semi": false,
"printWidth": 100
}
Copy link
Member

Choose a reason for hiding this comment

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

I think I will opt for the configuration we used in #8910

@dcousens
Copy link
Member

Superceded by #9144, but thanks @iamandrewluca for pushing this forward, as I know many contributors have been asking about the lack of any rules

@dcousens dcousens closed this May 14, 2024
@iamandrewluca iamandrewluca deleted the chore/add-prettier-format-on-commit branch May 14, 2024 03:07
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

2 participants