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: use prettier for local formatting #237

Merged
merged 3 commits into from
Dec 11, 2018
Merged

chore: use prettier for local formatting #237

merged 3 commits into from
Dec 11, 2018

Conversation

JustinBeckwith
Copy link
Collaborator

This is the first step towards a prettier migration. Adding the dependency, and using it to format our source only as a first step.

@codecov-io
Copy link

codecov-io commented Dec 10, 2018

Codecov Report

Merging #237 into master will increase coverage by <.01%.
The diff coverage is 99.62%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #237      +/-   ##
==========================================
+ Coverage   98.52%   98.53%   +<.01%     
==========================================
  Files          12       12              
  Lines         814      819       +5     
  Branches       65       68       +3     
==========================================
+ Hits          802      807       +5     
  Misses         12       12
Impacted Files Coverage Δ
src/clean.ts 100% <ø> (ø) ⬆️
src/format.ts 100% <100%> (ø) ⬆️
test/test-lint.ts 100% <100%> (ø) ⬆️
test/test-clean.ts 100% <100%> (ø) ⬆️
src/util.ts 100% <100%> (ø) ⬆️
src/lint.ts 100% <100%> (ø) ⬆️
test/fixtures.ts 100% <100%> (ø) ⬆️
test/test-kitchen.ts 100% <100%> (ø) ⬆️
test/test-util.ts 100% <100%> (ø) ⬆️
test/test-init.ts 100% <100%> (ø) ⬆️
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fa3e602...53d4e1c. Read the comment docs.

@JustinBeckwith JustinBeckwith requested a review from a team December 10, 2018 01:29
Copy link
Contributor

@ofrobots ofrobots left a comment

Choose a reason for hiding this comment

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

Fine. I'll get used to it. I would be interested in thoughts/objections from @google/google-node-team before this lands.

package.json Outdated
@@ -24,7 +24,7 @@
"codecov": "nyc report --reporter=json && codecov -f coverage/*.json",
"compile": "tsc -p .",
"format-check": "./bin/format-check.sh",
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this be just prettier --list-different glob now?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes it can! Good call out 👍

`${chalk.red('ERROR:')} ${chalk.gray('compilerOptions.outDir')} ` +
`cannot use the value '.'. That would delete all of our sources.`);
`${chalk.red('ERROR:')} ${chalk.gray('compilerOptions.outDir')} ` +
`cannot use the value '.'. That would delete all of our sources.`
Copy link
Contributor

Choose a reason for hiding this comment

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

meh.

I guess I will get used to it.

options: Options,
files: string[],
fix?: boolean
) => Promise<boolean>;
Copy link
Contributor

Choose a reason for hiding this comment

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

sigh.

I guess I will get used to it.

const BASE_ARGS_INLINE = [
'-style',
'{Language: JavaScript, BasedOnStyle: Google, ColumnLimit: 80}',
];
Copy link
Contributor

Choose a reason for hiding this comment

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

whatevs.

path.join(options.targetRootDir, '.clang-format')
)
? BASE_ARGS_FILE
: BASE_ARGS_INLINE;
Copy link
Contributor

Choose a reason for hiding this comment

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

😿

Copy link
Contributor

@kjin kjin left a comment

Choose a reason for hiding this comment

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

For the record, AFAIS I like this formatting pattern better.

@rgbkrk
Copy link

rgbkrk commented Dec 10, 2018

Hooray! This has been the only blocker for us to adopt ts-style as the dev tools are already in a good place for prettier across editors. Really easy to get people to adopt prettier across open source packages. ❤️

@JustinBeckwith JustinBeckwith merged commit 04a816f into google:master Dec 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants