Skip to content

Update rule description URLs to point to revive.run #1360

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion formatter/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ func (*Default) Format(failures <-chan lint.Failure, _ lint.Config) (string, err
}

func ruleDescriptionURL(ruleName string) string {
return "https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#" + ruleName
return "https://revive.run/r#" + ruleName
}
8 changes: 4 additions & 4 deletions formatter/formatter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func TestFormatter(t *testing.T) {
{
formatter: &formatter.Friendly{},
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

⚠ 1 problem (0 errors, 1 warning)
Expand All @@ -71,7 +71,7 @@ Warnings:
},
{
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{},
Expand Down Expand Up @@ -102,7 +102,7 @@ Warnings:
],
"tool": {
"driver": {
"informationUri": "https://github.com/mgechev/revive",
"informationUri": "https://revive.run",
"name": "revive"
}
}
Expand All @@ -116,7 +116,7 @@ Warnings:
formatter: &formatter.Stylish{},
want: `
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)
Expand Down
2 changes: 1 addition & 1 deletion formatter/sarif.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func (*Sarif) Name() string {
return "sarif"
}

const reviveSite = "https://github.com/mgechev/revive"
const reviveSite = "https://revive.run"

// Format formats the failures gotten from the lint.
func (*Sarif) Format(failures <-chan lint.Failure, cfg lint.Config) (string, error) {
Expand Down
10 changes: 5 additions & 5 deletions revivelib/core_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ func TestReviveFormat(t *testing.T) {
}

errorMsgs := []string{
"(91, 3) https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#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",
"(15, 2) https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#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.",
"(95, 3) https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#if-return redundant if ...; err != nil check, just return error instead.",
"(91, 3) https://revive.run/r#unreachable-code unreachable code after this statement",
"(98, 3) https://revive.run/r#unreachable-code unreachable code after this statement",
"(15, 2) https://revive.run/r#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://revive.run/r#if-return redundant if ...; err != nil check, just return error instead.",
}
for _, errorMsg := range errorMsgs {
if !strings.Contains(failures, errorMsg) {
Expand Down