@@ -10,7 +10,7 @@ const repolinter = require('repolinter') /*project which this is build upon */
10
10
11
11
const chalk = require ( 'chalk' )
12
12
13
- const formatedDate = new Date ( ) . toISOString ( ) . substring ( 0 , 13 ) /*transforms Date() into shorter string*/
13
+ const formattedDate = new Date ( ) . toISOString ( ) . substring ( 0 , 13 ) /*transforms Date() into shorter string*/
14
14
15
15
/* Separate negative and positive results and prints nicely in terminal */
16
16
const printResults = function ( data , results , log = console . log ) {
@@ -41,21 +41,17 @@ const printResults = function (data, results, log = console.log) {
41
41
42
42
/* Filter positive results and make it available to filter data */
43
43
const positiveResults = function ( results ) {
44
- const posResults = results /* filter messages for what didn't passed */
44
+ return results /* filter messages for what didn't passed */
45
45
. filter ( r => r . lintResult && r . lintResult . passed )
46
46
. map ( r => repolinter . runRuleset && r . ruleInfo . name )
47
-
48
- return posResults
49
47
}
50
48
51
49
/* Filter negative results and make it available to filter data */
52
50
const negativeResults = function ( results ) {
53
- const negResults = results
51
+ return results
54
52
. filter ( r => r . lintResult && ! r . lintResult . passed )
55
53
. map ( r => repolinter . runRuleset && r . ruleInfo . name )
56
54
57
- return negResults
58
-
59
55
/* In case someone needs an output with ratio */
60
56
/*
61
57
return {
@@ -98,7 +94,7 @@ const createJsonFile = async function (repository, input, results) {
98
94
}
99
95
100
96
await fs . promises . writeFile (
101
- path . resolve ( directory , `${ formatedDate } -${ repository } .json` ) ,
97
+ path . resolve ( directory , `${ formattedDate } -${ repository } .json` ) ,
102
98
JSON . stringify ( JSON . parse ( print ) , null , 2 )
103
99
)
104
100
}
@@ -111,7 +107,7 @@ const createJsonDashboardFile = async function (output) {
111
107
}
112
108
113
109
module . exports = {
114
- formatedDate ,
110
+ formattedDate ,
115
111
printResults,
116
112
positiveResults,
117
113
negativeResults,
0 commit comments