revive: update to 1.3.1.
This commit is contained in:
parent
be3efb9913
commit
62363da5d2
2 changed files with 57 additions and 4 deletions
53
srcpkgs/revive/patches/fix-tests.patch
Normal file
53
srcpkgs/revive/patches/fix-tests.patch
Normal file
|
@ -0,0 +1,53 @@
|
|||
From dc6909b49ff16af43ac29ce1e61265be33a3bf28 Mon Sep 17 00:00:00 2001
|
||||
From: chavacava <salvadorcavadini+github@gmail.com>
|
||||
Date: Mon, 1 May 2023 10:30:48 +0200
|
||||
Subject: [PATCH] fix tests not passing after the modif of the default rules
|
||||
list (#817)
|
||||
|
||||
---
|
||||
revivelib/core_test.go | 17 +++++++----------
|
||||
1 file changed, 7 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/revivelib/core_test.go b/revivelib/core_test.go
|
||||
index aa0ddb48..44ab6276 100644
|
||||
--- a/revivelib/core_test.go
|
||||
+++ b/revivelib/core_test.go
|
||||
@@ -26,17 +26,12 @@ func TestReviveLint(t *testing.T) {
|
||||
failureList = append(failureList, failure)
|
||||
}
|
||||
|
||||
- const expected = 3
|
||||
+ const expected = 5
|
||||
|
||||
got := len(failureList)
|
||||
if got != expected {
|
||||
t.Fatalf("Expected failures to have %d failures, but it has %d.", expected, got)
|
||||
}
|
||||
-
|
||||
- errmsg := "redundant if ...; err != nil check, just return error instead."
|
||||
- if failureList[0].Failure != errmsg {
|
||||
- t.Fatalf("Expected failure[0] to be '%s', but it was '%s'", errmsg, failureList[0].Failure)
|
||||
- }
|
||||
}
|
||||
|
||||
func TestReviveFormat(t *testing.T) {
|
||||
@@ -57,13 +52,15 @@ func TestReviveFormat(t *testing.T) {
|
||||
}
|
||||
|
||||
errorMsgs := []string{
|
||||
- "(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.",
|
||||
+ "(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) {
|
||||
- t.Fatalf("Expected formatted failures '%s' to contain '%s', but it didn't.", failures, errorMsg)
|
||||
+ t.Fatalf("Expected formatted failures\n'%s'\nto contain\n'%s', but it didn't.", failures, errorMsg)
|
||||
}
|
||||
}
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
# Template file for 'revive'
|
||||
pkgname=revive
|
||||
version=1.2.4
|
||||
revision=2
|
||||
version=1.3.1
|
||||
revision=1
|
||||
build_style=go
|
||||
go_ldflags="-X github.com/mgechev/revive/cli.version=$version"
|
||||
go_import_path="github.com/mgechev/revive"
|
||||
|
@ -10,8 +10,8 @@ maintainer="Roberto Ricci <ricci@disroot.org>"
|
|||
license="MIT"
|
||||
homepage="https://revive.run/"
|
||||
changelog="https://github.com/mgechev/revive/releases"
|
||||
distfiles="https://github.com/mgechev/revive/archive/v$version.tar.gz"
|
||||
checksum=bf2439a1a487274b7e37f84394dab87c2418e5396baffd501eb8543889564a2c
|
||||
distfiles="https://github.com/mgechev/revive/archive/refs/tags/v${version}.tar.gz"
|
||||
checksum=b3b8804024cd2aadb0900912560ad8718d5d1fc47fba7d95d281b46a24352267
|
||||
|
||||
do_check() {
|
||||
go test -v ./...
|
||||
|
|
Loading…
Add table
Reference in a new issue