Explorar o código

Precommit: Fixed precommit task issue (#18883)

Torkel Ödegaard %!s(int64=6) %!d(string=hai) anos
pai
achega
b0237c6b7e
Modificáronse 1 ficheiros con 5 adicións e 15 borrados
  1. 5 15
      packages/grafana-toolkit/src/cli/tasks/precommit.ts

+ 5 - 15
packages/grafana-toolkit/src/cli/tasks/precommit.ts

@@ -11,15 +11,6 @@ const simpleGit = require('simple-git/promise')(process.cwd());
 
 interface PrecommitOptions {}
 
-const tasks = {
-  test: {
-    lint: {
-      ts: ['no-only-tests'],
-      go: ['no-focus-convey-tests'],
-    },
-  },
-};
-
 interface GitStatus {
   files: GitFile[];
 }
@@ -40,27 +31,26 @@ const precommitRunner: TaskRunner<PrecommitOptions> = async () => {
     .filter(file => nodeVersionFiles.indexOf(file.path) !== -1)
     .map(f => f.path);
 
-  const taskPaths = [];
+  const gruntTasks = [];
 
   if (affectedNodeVersionFiles.length > 0) {
     await execTask(nodeVersionCheckerTask)({});
   }
 
   if (sassFiles.length > 0) {
-    taskPaths.push('lint.sass');
+    gruntTasks.push('sasslint');
   }
 
   if (testFiles.length) {
-    taskPaths.push('test.lint.ts');
+    gruntTasks.push('no-only-tests');
   }
 
   if (goTestFiles.length) {
-    taskPaths.push('test.lint.go');
+    gruntTasks.push('no-focus-convey-tests');
   }
 
-  const gruntTasks = flatten(taskPaths.map(path => get(tasks, path)));
   if (gruntTasks.length > 0) {
-    console.log(chalk.yellow(`Precommit checks: ${taskPaths.join(', ')}`));
+    console.log(chalk.yellow(`Precommit checks: ${gruntTasks.join(', ')}`));
     const task = execa('grunt', gruntTasks);
     // @ts-ignore
     const stream = task.stdout;