Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
b0237c6b
Unverified
Commit
b0237c6b
authored
Sep 04, 2019
by
Torkel Ödegaard
Committed by
GitHub
Sep 04, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Precommit: Fixed precommit task issue (#18883)
parent
cb4d30f8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
15 deletions
+5
-15
packages/grafana-toolkit/src/cli/tasks/precommit.ts
+5
-15
No files found.
packages/grafana-toolkit/src/cli/tasks/precommit.ts
View file @
b0237c6b
...
...
@@ -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
taskPath
s
=
[];
const
gruntTask
s
=
[];
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-tes
ts'
);
}
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:
${
taskPath
s
.
join
(
', '
)}
`
));
console
.
log
(
chalk
.
yellow
(
`Precommit checks:
${
gruntTask
s
.
join
(
', '
)}
`
));
const
task
=
execa
(
'grunt'
,
gruntTasks
);
// @ts-ignore
const
stream
=
task
.
stdout
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment