-
Notifications
You must be signed in to change notification settings - Fork 535
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
build: Make 'prettier -w .' work from the root #15759
Conversation
…of unique columns in telemetry (microsoft#15827) ## Description Precursors: * PR microsoft#12863 moved the typings for our internal loggers to telemetry-utils package and added support for arrays. * PR microsoft#15667 upgraded the client release group to use the new types This PR updates that type further to add support for flat objects. This has become a more common practice to consolidate event-specific properties, e.g. in a `details` object. Today instrumentation does the JSON.stringify itself, but this is not ideal. It's proven the utility of logging properties like this, so this PR adds first-class support for this. ## Breaking Changes Yes, this is a breaking change. If a logger implements the existing logger contracts based on the existing type, it will not necessarily be equipped to handle a flat object. In practice, there shouldn't be any follow-up required. These types are only used for our internal logging contracts, which are always fulfilled by a class derived from `TelemetryLogger`, which actually handles this case just fine without any changes. The API surface we expect partners to use always speaks in `ITelemetryBaseLogger` which is unchanged here.
package.json
Outdated
"prettier": "prettier --check . --ignore-path ./.prettierignore", | ||
"prettier:fix": "prettier --write . --ignore-path ./.prettierignore", |
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 will this start formatting the server release group when run from the root, right? Is that intended? I think it shouldn't...
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, it's intended. In the ideal case, this should never be a problem because CI enforces that everything is formatted properly already, so it shouldn't matter.
If we don't do it this way, where should the script to format the whole repo live?
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 think my honest answer to that is "here but server should live in a separate repo" 😆. Not strongly opposed to moving forward like this, just noting that my spidey sense reacted. One specific concern I have is if server folks update "their copy" of .prettierignore
but no the root; we expect CI to fail in that case because it will format from the root and cause the validation for unexpected file changes to complain?
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 created new prettier:repo and format:repo scripts so the old ones still stay scoped to the client release group.
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.
PR description maybe needs an update, but the change LGTM.
🔗 Found some broken links! 💔 Run a link check locally to find them. See linkcheck output
|
Related to microsoft#15758. This PR adds new prettier scripts to run on the whole repo. I also updated the prettierignore files to ignore additional files. The `prettier --write .` command should also now work from the root of any release group. --------- Co-authored-by: Scott Norton <scottnorton@microsoft.com> Co-authored-by: Mark Fields <markfields@users.noreply.github.com>
Related to #15758.
This PR adds new prettier scripts to run on the whole repo. I also updated the prettierignore files to ignore additional files. The
prettier --write .
command should also now work from the root of any release group.