From fa2d9f62d73778174cf0f2416317e70829c3537c Mon Sep 17 00:00:00 2001 From: aram price Date: Thu, 21 Mar 2024 17:12:24 -0700 Subject: [PATCH] License spec ignores `mock_` prefixed files - remove unnecessary Copyright header in generated mock since these are no longer in source control --- src/bpm/license_test.go | 2 +- src/bpm/runc/lifecycle/lifecycle.go | 4 ++-- src/bpm/runc/lifecycle/mock_lifecycle/header.txt | 14 -------------- 3 files changed, 3 insertions(+), 17 deletions(-) delete mode 100644 src/bpm/runc/lifecycle/mock_lifecycle/header.txt diff --git a/src/bpm/license_test.go b/src/bpm/license_test.go index 90905147..0593b2bc 100644 --- a/src/bpm/license_test.go +++ b/src/bpm/license_test.go @@ -61,7 +61,7 @@ var _ = Describe("our go source code", func() { } // Skip generated code - if strings.HasPrefix(filepath.Base(path), "fake_") { + if strings.HasPrefix(filepath.Base(path), "mock_") { return nil } diff --git a/src/bpm/runc/lifecycle/lifecycle.go b/src/bpm/runc/lifecycle/lifecycle.go index 2886f6df..f78ecb1b 100644 --- a/src/bpm/runc/lifecycle/lifecycle.go +++ b/src/bpm/runc/lifecycle/lifecycle.go @@ -34,6 +34,8 @@ import ( "bpm/usertools" ) +//go:generate go run go.uber.org/mock/mockgen -destination ./mock_lifecycle/mocks.go bpm/runc/lifecycle UserFinder,CommandRunner,RuncAdapter,RuncClient + const ( ContainerSigQuitGracePeriod = 2 * time.Second ContainerStatePollInterval = 1 * time.Second @@ -52,8 +54,6 @@ func IsNotExist(err error) bool { return err == isNotExistError } -//go:generate go run go.uber.org/mock/mockgen -copyright_file ./mock_lifecycle/header.txt -destination ./mock_lifecycle/mocks.go bpm/runc/lifecycle UserFinder,CommandRunner,RuncAdapter,RuncClient - type UserFinder interface { Lookup(username string) (specs.User, error) } diff --git a/src/bpm/runc/lifecycle/mock_lifecycle/header.txt b/src/bpm/runc/lifecycle/mock_lifecycle/header.txt deleted file mode 100644 index 7e543638..00000000 --- a/src/bpm/runc/lifecycle/mock_lifecycle/header.txt +++ /dev/null @@ -1,14 +0,0 @@ -Copyright (C) 2020-Present CloudFoundry.org Foundation, Inc. All rights reserved. - -This program and the accompanying materials are made available under -the terms of the under the Apache License, Version 2.0 (the "Licenseā€); -you may not use this file except in compliance with the License. - -You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -License for the specific language governing permissions and limitations -under the License.