Skip to content

Commit

Permalink
Fixes a small typo in the details provided with the `testing/coverage…
Browse files Browse the repository at this point in the history
…` rule as to where the coverage report should be placed
  • Loading branch information
bvobart committed Jun 25, 2021
1 parent 183a6f9 commit aa3e0ff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions linters/testing/linter.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,14 +207,14 @@ Please make sure your test report file is a valid JUnit XML file. %s`, l.Config.
func (l *TestingLinter) ScoreRuleTestCoverage(report *api.Report, project api.Project) {
if l.Config.Coverage.Report == "" {
report.Scores[RuleTestCoverage] = 0
report.Details[RuleTestCoverage] = "No test coverage report was provided. Please update the `testing.coverage` setting in your project's `mllint` configuration to specify the path to your project's test coverage report.\n\n" + howToMakeCoverageXML
report.Details[RuleTestCoverage] = "No test coverage report was provided. Please update the `testing.coverage.report` setting in your project's `mllint` configuration to specify the path to your project's test coverage report.\n\n" + howToMakeCoverageXML
return
}

covReportFile, err := utils.OpenFile(project.Dir, l.Config.Coverage.Report)
if err != nil {
report.Scores[RuleTestCoverage] = 0
report.Details[RuleTestCoverage] = fmt.Sprintf("A test coverage report was provided, namely `%s`, but this file could not be found or opened (%s). Please update the `testing.coverage` setting in your project's `mllint` configuration to fix the path to your project's test report. Remember that this path must be relative to the root of your project directory.", l.Config.Coverage.Report, err.Error())
report.Details[RuleTestCoverage] = fmt.Sprintf("A test coverage report was provided, namely `%s`, but this file could not be found or opened (%s). Please update the `testing.coverage.report` setting in your project's `mllint` configuration to fix the path to your project's test report. Remember that this path must be relative to the root of your project directory.", l.Config.Coverage.Report, err.Error())
return
}

Expand Down
4 changes: 2 additions & 2 deletions linters/testing/linter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func TestTestingLinter(t *stdtesting.T) {

require.EqualValues(t, 0, report.Scores[testing.RuleTestCoverage])
require.Contains(t, report.Details[testing.RuleTestCoverage], "No test coverage report was provided")
require.Contains(t, report.Details[testing.RuleTestCoverage], "update the `testing.coverage` setting")
require.Contains(t, report.Details[testing.RuleTestCoverage], "update the `testing.coverage.report` setting")

require.EqualValues(t, 0, report.Scores[testing.RuleTestsFolder])
},
Expand Down Expand Up @@ -282,7 +282,7 @@ func TestTestingLinter(t *stdtesting.T) {
require.EqualValues(t, 0, report.Scores[testing.RuleTestCoverage])
require.Contains(t, report.Details[testing.RuleTestCoverage], "`non-existant-file.xml`")
require.Contains(t, report.Details[testing.RuleTestCoverage], "file could not be found")
require.Contains(t, report.Details[testing.RuleTestCoverage], "update the `testing.coverage` setting")
require.Contains(t, report.Details[testing.RuleTestCoverage], "update the `testing.coverage.report` setting")
},
},
{
Expand Down

0 comments on commit aa3e0ff

Please sign in to comment.