-
Notifications
You must be signed in to change notification settings - Fork 50
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
Added prettier, lint-staged and husky. #139
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a GitHub Action for using Prettier?
Here is an example: https://github.com/tristan957/libmerr/blob/master/.github/workflows/prettier.yaml
package.json
Outdated
"dependencies": {} | ||
"dependencies": {}, | ||
"prettier": { | ||
"printWidth": 100 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's just finish the rest of the config.
Determine if we are using tabs or spaces, and choose it.
semi: true
singleQuote: false
quoteProps: as-needed
jsxSingleQuote: false
trailingCommas: all
bracketSpacing: true
bracketSameLine: false
arrowParens: true
wrapProse: always
endOfLine: lf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spaces
GH action - sure, will take a look at some point. |
I haven't looked at anything but the initial MR message. I'd be happy with 100 or 120 column widths. I'd prefer not to go wider than that as I usually have two files opened side-by side. I think Meson itself is 100? |
@lukester1975 any time to come back to this? |
a52e154
to
d65cb86
Compare
Run prettier as a pre-commit hook.
6a9597e
to
c6b3c0a
Compare
I'm not a GH actions person but this appears to work based of yours @tristan957.
Not sure I see the point of specifying options with the default values: as soon as a new value is added, it's no longer complete anyway. Plus if a default ever changes, highlighting that fact and reviewing what is preferred is a good thing IMHO. Plus package.json is too long as it is... |
@@ -16,12 +16,12 @@ permissions: | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for keeping the reformatting a separate commit. Could you add one more commit to this PR that adds a .git-blame-ignore-revs file to the root of the repo? Similar to https://github.com/llvm/llvm-project/blob/main/.git-blame-ignore-revs. The only known entry would the commit where you reformatted everything.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Already is one apparently, so I've added the commit. Will try to remember it on next rebase, unless this is getting merged soon...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am ready to merge. Are you good to go?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, if you are. Checks are still queued though...
c6b3c0a
to
5b4d8d9
Compare
Weird. I will watch it. |
As suggested in #68.
Just a stab at a prettier config. (I personally don't understand the preference for 80 columns... my monitor is wider than I am tall, and I'm 6'5")
print-width 100 example: https://github.com/lukester1975/vscode-meson/compare/78052ee5f2c33fcdaa25b93698726b10d658a71d..1fbd08082f804f73366ba032005d3101005d9f1d
80: https://github.com/lukester1975/vscode-meson/compare/78052ee5f2c33fcdaa25b93698726b10d658a71d..856fbf0fa785f62117d4af8da0ad58baa0fc2645