Merge remote-tracking branch 'origin/feat/extension-platform' into feat/extension-platform

# Conflicts:
#	cmd/config/plugins.go
#	cmd/platform_guards_test.go
#	cmd/plugin_integration_test.go
#	internal/platform/host_test.go
This commit is contained in:
shanglei
2026-05-16 11:49:39 +08:00
6 changed files with 6 additions and 10 deletions

View File

@@ -8,7 +8,7 @@ import (
"github.com/larksuite/cli/internal/cmdutil"
"github.com/larksuite/cli/internal/output"
"github.com/larksuite/cli/internal/platform"
internalplatform "github.com/larksuite/cli/internal/platform"
)
// NewCmdConfigPlugins exposes the plugin inventory diagnostic command.

View File

@@ -15,7 +15,7 @@ import (
"github.com/larksuite/cli/extension/platform"
"github.com/larksuite/cli/internal/hook"
"github.com/larksuite/cli/internal/output"
"github.com/larksuite/cli/internal/platform"
internalplatform "github.com/larksuite/cli/internal/platform"
)
// failClosedAbortingPlugin returns a PluginInstallError on Install,
@@ -158,7 +158,6 @@ func TestNamespacedWrap_doesNotMutateSharedAbortError(t *testing.T) {
var wg sync.WaitGroup
wg.Add(2)
for i, m := range matched {
i, m := i, m
go func() {
defer wg.Done()
err := m.Fn(func(context.Context, platform.Invocation) error { return nil })(

View File

@@ -18,7 +18,7 @@ import (
"github.com/larksuite/cli/internal/cmdutil"
"github.com/larksuite/cli/internal/hook"
"github.com/larksuite/cli/internal/output"
"github.com/larksuite/cli/internal/platform"
internalplatform "github.com/larksuite/cli/internal/platform"
)
// These integration tests exercise the Hook framework's plumbing
@@ -231,9 +231,6 @@ func TestPluginPipeline_denialGuardIntegrated(t *testing.T) {
t.Cleanup(platform.ResetForTesting)
wrapCalled := false
type wrapPlugin struct{}
// We use an anonymous Plugin via fakeIntegrationPlugin to keep
// the test focused.
plugin := &fakeIntegrationPlugin{
name: "policy-plugin",
caps: platform.Capabilities{FailurePolicy: platform.FailOpen},

View File

@@ -8,4 +8,4 @@ import "os"
// defaultStderr is the real os.Stderr writer. Kept in a separate file so
// tests can replace `stderr` (in install.go) with a buffer without
// shadowing this variable.
var defaultStderr = os.Stderr
var defaultStderr = os.Stderr //nolint:forbidigo // framework-level fallback writer; hooks fire before IOStreams plumbing is available

View File

@@ -11,7 +11,7 @@ import (
"testing"
"github.com/larksuite/cli/extension/platform"
"github.com/larksuite/cli/internal/platform"
internalplatform "github.com/larksuite/cli/internal/platform"
)
// happyPlugin is a textbook plugin: declares Capabilities, calls a few

View File

@@ -69,7 +69,7 @@ func satisfiesRequiredCLIVersion(buildVersion, constraint string) (bool, error)
if err != nil {
// Build version is unparseable -- treat as DEV so an exotic
// build tag doesn't lock plugins out.
return true, nil
return true, nil //nolint:nilerr // intentional fail-open for unparseable buildVersion
}
cmp := compareSemver(bv, rv)
switch op {