[MM-19948] Set version on module file and internal paths (#13186)
* [MM-19948] Set version on module file and internal paths * Fixes after merge * Fix i18n checker error
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
14bcd1f0a1
Коммит
2259b7f2a8
@@ -8,8 +8,8 @@ import (
|
||||
"go/ast"
|
||||
"go/token"
|
||||
|
||||
"github.com/mattermost/mattermost-server/plugin/checker/internal/asthelpers"
|
||||
"github.com/mattermost/mattermost-server/plugin/checker/internal/version"
|
||||
"github.com/mattermost/mattermost-server/v5/plugin/checker/internal/asthelpers"
|
||||
"github.com/mattermost/mattermost-server/v5/plugin/checker/internal/version"
|
||||
)
|
||||
|
||||
func checkAPIVersionComments(pkgPath string) (result, error) {
|
||||
|
||||
@@ -17,24 +17,24 @@ func TestCheckAPIVersionComments(t *testing.T) {
|
||||
}{
|
||||
{
|
||||
name: "valid comments",
|
||||
pkgPath: "github.com/mattermost/mattermost-server/plugin/checker/internal/test/valid",
|
||||
pkgPath: "github.com/mattermost/mattermost-server/v5/plugin/checker/internal/test/valid",
|
||||
err: "",
|
||||
},
|
||||
{
|
||||
name: "invalid comments",
|
||||
pkgPath: "github.com/mattermost/mattermost-server/plugin/checker/internal/test/invalid",
|
||||
pkgPath: "github.com/mattermost/mattermost-server/v5/plugin/checker/internal/test/invalid",
|
||||
expected: result{
|
||||
Errors: []string{"internal/test/invalid/invalid.go:15:2: missing a minimum server version comment on method InvalidMethod"},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "missing API interface",
|
||||
pkgPath: "github.com/mattermost/mattermost-server/plugin/checker/internal/test/missing",
|
||||
pkgPath: "github.com/mattermost/mattermost-server/v5/plugin/checker/internal/test/missing",
|
||||
err: "could not find API interface",
|
||||
},
|
||||
{
|
||||
name: "non-existent package path",
|
||||
pkgPath: "github.com/mattermost/mattermost-server/plugin/checker/internal/test/does_not_exist",
|
||||
pkgPath: "github.com/mattermost/mattermost-server/v5/plugin/checker/internal/test/does_not_exist",
|
||||
err: "could not find API interface",
|
||||
},
|
||||
}
|
||||
|
||||
@@ -9,8 +9,8 @@ import (
|
||||
"go/token"
|
||||
"go/types"
|
||||
|
||||
"github.com/mattermost/mattermost-server/plugin/checker/internal/asthelpers"
|
||||
"github.com/mattermost/mattermost-server/plugin/checker/internal/version"
|
||||
"github.com/mattermost/mattermost-server/v5/plugin/checker/internal/asthelpers"
|
||||
"github.com/mattermost/mattermost-server/v5/plugin/checker/internal/version"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
@@ -17,12 +17,12 @@ func TestCheckHelpersVersionComments(t *testing.T) {
|
||||
}{
|
||||
{
|
||||
name: "valid versions",
|
||||
pkgPath: "github.com/mattermost/mattermost-server/plugin/checker/internal/test/valid",
|
||||
pkgPath: "github.com/mattermost/mattermost-server/v5/plugin/checker/internal/test/valid",
|
||||
expected: result{},
|
||||
},
|
||||
{
|
||||
name: "invalid versions",
|
||||
pkgPath: "github.com/mattermost/mattermost-server/plugin/checker/internal/test/invalid",
|
||||
pkgPath: "github.com/mattermost/mattermost-server/v5/plugin/checker/internal/test/invalid",
|
||||
expected: result{
|
||||
Errors: []string{"internal/test/invalid/invalid.go:20:2: documented minimum server version too low on method LowerVersionMethod"},
|
||||
Warnings: []string{"internal/test/invalid/invalid.go:23:2: documented minimum server version too high on method HigherVersionMethod"},
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
const pluginPackagePath = "github.com/mattermost/mattermost-server/plugin"
|
||||
const pluginPackagePath = "github.com/mattermost/mattermost-server/v5/plugin"
|
||||
|
||||
type result struct {
|
||||
Warnings []string
|
||||
|
||||
Ссылка в новой задаче
Block a user