-
Notifications
You must be signed in to change notification settings - Fork 207
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
Prettier 3.0 #8030
Prettier 3.0 #8030
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.
I'm a bit concerned about the generated declare
things, but I suppose the tools will catch them next time too.
console.warn('running with options', opts); | ||
const { agoricNames, lookupPsmInstance } = await rpcTools(); | ||
const instance = await lookupPsmInstance(opts.pair); | ||
const offer = Offers.psm.swap(agoricNames, instance, opts); | ||
outputExecuteOfferAction(offer); |
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.
sigh... indenting the whole body of the function is mildly annoying. If I saw this while writing code, I might shift things around.
declare type Builtin = | ||
type Builtin = |
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.
ugh. this code is generated by some protobuf tool. next time we run that tool (yarn generate
) it's going to say declare
again, IIUC. I wonder if this is a known issue upstream in the protobuf tool.
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.
this was generated by yarn rebuild
which runs yarn generate
. I put this into a separate commit, before changing Prettier: 87a2df6
? object.messages.map((e) => String(e)) | ||
? object.messages.map(e => String(e)) |
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.
again, this is generated code. Any clues on why our lint tools didn't complain about it when it was originally merged?
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.
this is the generated code after being prettiered (yarn rebuild
runs prettier). The change in b46c46 is to use the same Prettier config for this package as for agoric-sdk, i.e. "arrowParens": "avoid"
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'm confused, are you saying the codegen steps already re-format generated code?
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.
Yes.
"rebuild": "rm -rf gen && mkdir -p gen && yarn generate && tsc --build && yarn prettier -w dist/agoric && rm -rf gen", |
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.
Linting tools should not touch generated code
Description
https://prettier.io/blog/2023/07/05/3.0.0.html
Also has a 'yarn rebuild' of cosmic-proto that was affected by #7822
uses alpha version of
eslint-plugin-prettier
due to prettier/eslint-plugin-prettier#562Security Considerations
Scaling Considerations
Documentation Considerations
Testing Considerations
CI