@@ -11,7 +11,6 @@ import (
1111 diffpkg "github.com/sourcegraph/go-diff/diff"
1212 "golang.org/x/tools/go/analysis"
1313
14- "github.com/golangci/golangci-lint/pkg/config"
1514 "github.com/golangci/golangci-lint/pkg/goanalysis"
1615 "github.com/golangci/golangci-lint/pkg/lint/linter"
1716 "github.com/golangci/golangci-lint/pkg/logutils"
@@ -30,8 +29,6 @@ const (
3029 diffLineDeleted diffLineType = "deleted"
3130)
3231
33- type fmtTextFormatter func (settings * config.LintersSettings ) string
34-
3532type diffLine struct {
3633 originalNumber int // 1-based original line number
3734 typ diffLineType
@@ -219,7 +216,6 @@ func ExtractDiagnosticFromPatch(
219216 file * ast.File ,
220217 patch string ,
221218 lintCtx * linter.Context ,
222- formatter fmtTextFormatter ,
223219) error {
224220 diffs , err := diffpkg .ParseMultiFileDiff ([]byte (patch ))
225221 if err != nil {
@@ -246,23 +242,23 @@ func ExtractDiagnosticFromPatch(
246242 changes := p .parse (hunk )
247243
248244 for _ , change := range changes {
249- pass .Report (toDiagnostic (ft , change , formatter ( lintCtx . Settings ()), adjLine ))
245+ pass .Report (toDiagnostic (ft , change , adjLine ))
250246 }
251247 }
252248 }
253249
254250 return nil
255251}
256252
257- func toDiagnostic (ft * token.File , change Change , message string , adjLine int ) analysis.Diagnostic {
253+ func toDiagnostic (ft * token.File , change Change , adjLine int ) analysis.Diagnostic {
258254 start := ft .LineStart (change .From + adjLine )
259255
260256 end := goanalysis .EndOfLinePos (ft , change .To + adjLine )
261257
262258 return analysis.Diagnostic {
263259 Pos : start ,
264260 End : end ,
265- Message : message , // TODO(ldez) change message formatter to have a better message.
261+ Message : "File is not properly formatted" ,
266262 SuggestedFixes : []analysis.SuggestedFix {{
267263 TextEdits : []analysis.TextEdit {{
268264 Pos : start ,
0 commit comments