mirror of
https://github.com/mgechev/revive.git
synced 2025-11-23 22:04:49 +02:00
fix: update rule description URLs to point to revive.run (#1360)
This commit is contained in:
@@ -28,5 +28,5 @@ func (*Default) Format(failures <-chan lint.Failure, _ lint.Config) (string, err
|
|||||||
}
|
}
|
||||||
|
|
||||||
func ruleDescriptionURL(ruleName string) string {
|
func ruleDescriptionURL(ruleName string) string {
|
||||||
return "https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#" + ruleName
|
return "https://revive.run/r#" + ruleName
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ func TestFormatter(t *testing.T) {
|
|||||||
{
|
{
|
||||||
formatter: &formatter.Friendly{},
|
formatter: &formatter.Friendly{},
|
||||||
want: `
|
want: `
|
||||||
⚠ https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#rule test failure
|
⚠ https://revive.run/r#rule test failure
|
||||||
test.go:2:5
|
test.go:2:5
|
||||||
|
|
||||||
⚠ 1 problem (0 errors, 1 warning)
|
⚠ 1 problem (0 errors, 1 warning)
|
||||||
@@ -71,7 +71,7 @@ Warnings:
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
formatter: &formatter.Plain{},
|
formatter: &formatter.Plain{},
|
||||||
want: `test.go:2:5: test failure https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#rule`,
|
want: `test.go:2:5: test failure https://revive.run/r#rule`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
formatter: &formatter.Sarif{},
|
formatter: &formatter.Sarif{},
|
||||||
@@ -102,7 +102,7 @@ Warnings:
|
|||||||
],
|
],
|
||||||
"tool": {
|
"tool": {
|
||||||
"driver": {
|
"driver": {
|
||||||
"informationUri": "https://github.com/mgechev/revive",
|
"informationUri": "https://revive.run",
|
||||||
"name": "revive"
|
"name": "revive"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -116,7 +116,7 @@ Warnings:
|
|||||||
formatter: &formatter.Stylish{},
|
formatter: &formatter.Stylish{},
|
||||||
want: `
|
want: `
|
||||||
test.go
|
test.go
|
||||||
(2, 5) https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#rule test failure
|
(2, 5) https://revive.run/r#rule test failure
|
||||||
|
|
||||||
|
|
||||||
✖ 1 problem (0 errors) (1 warning)
|
✖ 1 problem (0 errors) (1 warning)
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ func (*Sarif) Name() string {
|
|||||||
return "sarif"
|
return "sarif"
|
||||||
}
|
}
|
||||||
|
|
||||||
const reviveSite = "https://github.com/mgechev/revive"
|
const reviveSite = "https://revive.run"
|
||||||
|
|
||||||
// Format formats the failures gotten from the lint.
|
// Format formats the failures gotten from the lint.
|
||||||
func (*Sarif) Format(failures <-chan lint.Failure, cfg lint.Config) (string, error) {
|
func (*Sarif) Format(failures <-chan lint.Failure, cfg lint.Config) (string, error) {
|
||||||
|
|||||||
@@ -54,11 +54,11 @@ func TestReviveFormat(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
errorMsgs := []string{
|
errorMsgs := []string{
|
||||||
"(91, 3) https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unreachable-code unreachable code after this statement",
|
"(91, 3) https://revive.run/r#unreachable-code unreachable code after this statement",
|
||||||
"(98, 3) https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unreachable-code unreachable code after this statement",
|
"(98, 3) https://revive.run/r#unreachable-code unreachable code after this statement",
|
||||||
"(15, 2) https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#if-return redundant if ...; err != nil check, just return error instead.",
|
"(15, 2) https://revive.run/r#if-return redundant if ...; err != nil check, just return error instead.",
|
||||||
"(88, 3) https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#if-return redundant if ...; err != nil check, just return error instead.",
|
"(88, 3) https://revive.run/r#if-return redundant if ...; err != nil check, just return error instead.",
|
||||||
"(95, 3) https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#if-return redundant if ...; err != nil check, just return error instead.",
|
"(95, 3) https://revive.run/r#if-return redundant if ...; err != nil check, just return error instead.",
|
||||||
}
|
}
|
||||||
for _, errorMsg := range errorMsgs {
|
for _, errorMsg := range errorMsgs {
|
||||||
if !strings.Contains(failures, errorMsg) {
|
if !strings.Contains(failures, errorMsg) {
|
||||||
|
|||||||
Reference in New Issue
Block a user