Skip to content

Commit

Permalink
Pre-commit via make
Browse files Browse the repository at this point in the history
  • Loading branch information
hiddenmarten committed Mar 10, 2024
1 parent d18bf37 commit 90d8cd4
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 3 deletions.
23 changes: 23 additions & 0 deletions .pre-commit-config.yaml
@@ -0,0 +1,23 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-added-large-files
- repo: local
hooks:
- id: make-fmt
name: make-fmt
entry: sh -c "make fmt"
language: system
- id: make-vet
name: make-vet
entry: sh -c "make vet"
language: system
- id: make-lint-fix
name: make-lint-fix
entry: sh -c "make lint-fix"
language: system
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -61,7 +61,7 @@ vet: ## Run go vet against code.
go vet ./...

.PHONY: test
test: manifests generate fmt vet envtest ## Run tests.
test: manifests generate fmt vet ## Run tests.
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test $$(go list ./... | grep -v /e2e) -coverprofile cover.out

# Utilize Kind or modify the e2e tests to load the image locally, enabling compatibility with other vendors.
Expand Down
4 changes: 4 additions & 0 deletions README.md
@@ -1,2 +1,6 @@
# etcd-operator
New generation community-driven etcd-operator!

## Contributing
### Prerequisites
- [pre-commit](https://pre-commit.com/#installation)
2 changes: 1 addition & 1 deletion hack/boilerplate.go.txt
Expand Up @@ -12,4 +12,4 @@ 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.
*/
*/
3 changes: 2 additions & 1 deletion test/e2e/e2e_test.go
Expand Up @@ -73,7 +73,8 @@ var _ = Describe("controller", Ordered, func() {

By("installing CRDs")
cmd = exec.Command("make", "install")
_, err = utils.Run(cmd)
// TODO: Handle CRD installation error
_, _ = utils.Run(cmd)

By("deploying the controller-manager")
cmd = exec.Command("make", "deploy", fmt.Sprintf("IMG=%s", projectimage))
Expand Down

0 comments on commit 90d8cd4

Please sign in to comment.