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

Formattted everything with prettier #1879

Merged
merged 10 commits into from
Jun 30, 2017
Merged

Conversation

Chillee
Copy link
Member

@Chillee Chillee commented Jun 28, 2017

Before we merge this, I think it'd be a good idea to put some kind of commit hook so new contributors wouldn't have to use prettier.

However, it wouldn't be the end of the world to run prettier manually once in a while.

The settings I ran it with were

prettier --write --print-width 100 --single-quote --trailing-comma es5

Opinions on these settings?

@jpoon
Copy link
Member

jpoon commented Jun 28, 2017

My 2cents. Add a gulp task and do it manually once in awhile. As we talked about on Slack, 15seconds is a looong time to wait.

@Chillee
Copy link
Member Author

Chillee commented Jun 28, 2017

@jpoon What we can do is just do only prettier on the changed files. That'd reduce the time down to <1s total.

@Chillee
Copy link
Member Author

Chillee commented Jun 28, 2017

@jpoon For example, on the most recent commit, prettier only took 300 ms to run.

@Chillee
Copy link
Member Author

Chillee commented Jun 28, 2017

The only thing left to do is to fail the CI if not all the code is prettified.

@Chillee Chillee force-pushed the prettier branch 6 times, most recently from 8520b30 to 7b4b8ef Compare June 28, 2017 08:48
@Chillee
Copy link
Member Author

Chillee commented Jun 28, 2017

Cool! I think everything should work. @jpoon I dunno if I did something horrendous to the gulp or travis files, so I'd appreciate a quick review on that.

.pipe(tslint({ formatter: 'verbose' }))
.pipe(tslint.report(tslintOptions));
return merge(srcs, tests);
});

gulp.task('default', ['tslint', 'compile']);
gulp.task(
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Mainly because that package isn't maintained, and it's missing the "es5" trailing commas option.

@Chillee Chillee merged commit eae1835 into VSCodeVim:master Jun 30, 2017
@@ -28,6 +28,8 @@ install:
- npm install;

script:
- git ls-tree -r master --name-only | grep ".*.[t|j]s$" | xargs ./node_modules/prettier/bin/prettier.js --write --print-width 100 --single-quote --trailing-comma es5
Copy link
Member

Choose a reason for hiding this comment

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

You could have called the gulp task here?

Copy link
Member Author

Choose a reason for hiding this comment

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

I was thinking that we should be checking all the files to see if any of them haven't been prettified.

I think I set up gulp prettier to only prettify files that have changed since the last commit.

Come to think of it, I think this workflow can be improved...

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.

2 participants