Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Datree
Commits
789bd8c8
Commit
789bd8c8
authored
3 years ago
by
shalev avhar
Browse files
Options
Download
Email Patches
Plain Diff
refactor: change failedRuleData to failedRule variable name
parent
d2d6d1c1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bl/evaluation/evaluator.go
+6
-6
bl/evaluation/evaluator.go
with
6 additions
and
6 deletions
+6
-6
bl/evaluation/evaluator.go
+
6
-
6
View file @
789bd8c8
...
@@ -275,21 +275,21 @@ func (e *Evaluator) formatEvaluationResults(evaluationResults FailedRulesByFiles
...
@@ -275,21 +275,21 @@ func (e *Evaluator) formatEvaluationResults(evaluationResults FailedRulesByFiles
totalPassedCount
=
totalPassedCount
-
1
totalPassedCount
=
totalPassedCount
-
1
}
}
for
ruleIdentifier
,
failedRule
Data
:=
range
evaluationResults
[
filePath
]
{
for
ruleIdentifier
,
failedRule
:=
range
evaluationResults
[
filePath
]
{
// file and rule not already exists in mapper
// file and rule not already exists in mapper
// all configuration is skipped then skip
if
_
,
exists
:=
mapper
[
filePath
][
ruleIdentifier
];
!
exists
{
if
_
,
exists
:=
mapper
[
filePath
][
ruleIdentifier
];
!
exists
{
totalFailedCount
++
totalFailedCount
++
mapper
[
filePath
][
ruleIdentifier
]
=
&
Rule
{
mapper
[
filePath
][
ruleIdentifier
]
=
&
Rule
{
Identifier
:
ruleIdentifier
,
Identifier
:
ruleIdentifier
,
Name
:
failedRule
Data
.
Name
,
Name
:
failedRule
.
Name
,
DocumentationUrl
:
failedRule
Data
.
DocumentationUrl
,
DocumentationUrl
:
failedRule
.
DocumentationUrl
,
MessageOnFailure
:
failedRule
Data
.
MessageOnFailure
,
MessageOnFailure
:
failedRule
.
MessageOnFailure
,
OccurrencesDetails
:
[]
OccurrenceDetails
{},
OccurrencesDetails
:
[]
OccurrenceDetails
{},
}
}
}
}
for
_
,
configuration
:=
range
failedRule
Data
.
Configurations
{
for
_
,
configuration
:=
range
failedRule
.
Configurations
{
mapper
[
filePath
][
ruleIdentifier
]
.
OccurrencesDetails
=
append
(
mapper
[
filePath
][
ruleIdentifier
]
.
OccurrencesDetails
=
append
(
mapper
[
filePath
][
ruleIdentifier
]
.
OccurrencesDetails
,
mapper
[
filePath
][
ruleIdentifier
]
.
OccurrencesDetails
,
OccurrenceDetails
{
MetadataName
:
configuration
.
Name
,
Kind
:
configuration
.
Kind
,
Occurrences
:
configuration
.
Occurrences
},
OccurrenceDetails
{
MetadataName
:
configuration
.
Name
,
Kind
:
configuration
.
Kind
,
Occurrences
:
configuration
.
Occurrences
},
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
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
Menu
Projects
Groups
Snippets
Help