Skip to content

Commit 9da7594

Browse files
committed
Address some PR comments
1 parent c9842c5 commit 9da7594

File tree

3 files changed

+15
-9
lines changed

3 files changed

+15
-9
lines changed

tools/gitHooks/license.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ function rewriteCopyrightLine(contents) {
7676
return newLines.join('\n');
7777
}
7878

79-
async function doLicenseCommit(changedFiles) {
79+
async function doLicense(changedFiles) {
8080
const licenseSpinner = ora(' Validating License Headers').start();
8181

8282
const paths = changedFiles.filter(line => line.match(/(js|ts)$/));
@@ -115,7 +115,7 @@ async function doLicenseCommit(changedFiles) {
115115
symbol: '✅'
116116
});
117117

118-
// Diff unstaged (prettier writes) against staged.
118+
// Diff unstaged (license writes) against staged.
119119
const stageDiff = await git.diff(['--name-only']);
120120

121121
if (!stageDiff) {
@@ -136,5 +136,5 @@ async function doLicenseCommit(changedFiles) {
136136
}
137137

138138
module.exports = {
139-
doLicenseCommit
139+
doLicense
140140
};

tools/gitHooks/precommit.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
* limitations under the License.
1616
*/
1717

18-
const { doPrettierCommit } = require('./prettier');
19-
const { doLicenseCommit } = require('./license');
18+
const { doPrettier } = require('./prettier');
19+
const { doLicense } = require('./license');
2020
const { resolve } = require('path');
2121
const simpleGit = require('simple-git/promise');
2222
const ora = require('ora');
@@ -75,11 +75,17 @@ $ git stash pop
7575
const changedFiles = diff.split('\n');
7676

7777
// Style the code
78-
await doPrettierCommit(changedFiles);
78+
await doPrettier(changedFiles);
7979

8080
// Validate License headers exist
81-
await doLicenseCommit(changedFiles);
81+
await doLicense(changedFiles);
8282

83+
<<<<<<< HEAD
84+
=======
85+
// Generate API reports
86+
await doApiReports(changedFiles);
87+
88+
>>>>>>> 391f3e4b... Address some PR comments
8389
// Diff staged changes against last commit. Don't do an empty commit.
8490
const postDiff = await git.diff(['--cached']);
8591
if (!postDiff) {

tools/gitHooks/prettier.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ function checkVersion() {
5656
});
5757
}
5858

59-
async function doPrettierCommit(changedFiles) {
59+
async function doPrettier(changedFiles) {
6060
try {
6161
await checkVersion();
6262
} catch (e) {
@@ -108,5 +108,5 @@ async function doPrettierCommit(changedFiles) {
108108
}
109109

110110
module.exports = {
111-
doPrettierCommit
111+
doPrettier
112112
};

0 commit comments

Comments
 (0)