diff --git a/.husky/pre-commit b/.husky/pre-push similarity index 62% rename from .husky/pre-commit rename to .husky/pre-push index 3cdab8574..c76f3f6a9 100755 --- a/.husky/pre-commit +++ b/.husky/pre-push @@ -1,4 +1,4 @@ #!/bin/sh . "$(dirname "$0")/_/husky.sh" -npx gulp lint-pre-commit +npx gulp lint diff --git a/gulpfile.js b/gulpfile.js index 259f11383..488f0d623 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -302,15 +302,8 @@ const runPrettier = async fix => { }); }; -const findChangedFiles = async () => { - const data = await promisify(cp.exec)("git diff --name-only HEAD"); - return data.stderr - ? assert(false, data.stderr) - : data.stdout.replace(/\r\n/g, "\n").split("\n"); -}; - /** - * @typedef {{color: boolean, fix: boolean, changedOnly: boolean}} OptionsT + * @typedef {{color: boolean, fix: boolean}} OptionsT */ /** @@ -318,15 +311,9 @@ const findChangedFiles = async () => { */ const runEslint = async options_ => { /** @type {OptionsT} */ - const options = Object.assign({ color: true, fix: false, changedOnly: false }, options_); + const options = Object.assign({ color: true, fix: false }, options_); - const files = options.changedOnly - ? await findChangedFiles().then(it => it.filter(it => it.startsWith("src"))) - : ["src/**/*.ts"]; - - if (files.length === 0) { - return; - } + const files = ["src/**/*.ts"]; const args = [ ...(options.color ? ["--color"] : ["--no-color"]), @@ -353,7 +340,6 @@ gulp.task("format", gulp.series("format:prettier", "format:eslint")); gulp.task("lint:prettier", () => runPrettier(false)); gulp.task("lint:eslint", () => runEslint({ fix: false })); gulp.task("lint", gulp.series("lint:prettier", "lint:eslint")); -gulp.task("lint-pre-commit", () => runEslint({ fix: false, color: false, changedOnly: true })); /** Run webpack to bundle the extension output files */ gulp.task("webpack-bundle", async () => {