Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

Extract the framing functionality to its own package #48

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions .github/workflows/golangci-lint.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
# https://github.com/marketplace/actions/run-golangci-lint
name: golangci-lint

on:
pull_request:
push:
branches: [master]

tags:
- v*
branches:
- master
- main
pull_request:
jobs:
golangci:
name: Linter
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: golangci-lint
uses: golangci/golangci-lint-action@v1
uses: golangci/golangci-lint-action@v2
with:
version: v1.28
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
version: v1.29
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
.vscode/

# Binary artifacts
bin/
bin/
# Don't check in the vendor directory
vendor
26 changes: 14 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
UID_GID ?= $(shell id -u):$(shell id -g)
GO_VERSION ?= 1.14.4
GO_VERSION ?= 1.16.5
GIT_VERSION := $(shell hack/ldflags.sh --version-only)
PROJECT := github.com/weaveworks/libgitops
BOUNDING_API_DIRS := ${PROJECT}/cmd/apis/sample
Expand Down Expand Up @@ -33,18 +33,18 @@ docker-%:
"golang:${GO_VERSION}" make $*

test: docker-test-internal
test-internal:
test-internal: tidy-internal
go test -v $(addsuffix /...,$(addprefix ./,${SRC_PKGS}))

tidy: docker-tidy-internal
tidy-internal: /go/bin/goimports
go mod tidy
hack/generate-client.sh
if [ -d vendor ]; then go mod vendor; fi
gofmt -s -w ${SRC_PKGS}
goimports -w ${SRC_PKGS}

autogen: docker-autogen-internal
autogen-internal: /go/bin/deepcopy-gen /go/bin/defaulter-gen /go/bin/conversion-gen /go/bin/openapi-gen
autogen-internal: /go/bin/deepcopy-gen /go/bin/defaulter-gen /go/bin/conversion-gen
# Let the boilerplate be empty
touch /tmp/boilerplate

Expand All @@ -63,21 +63,23 @@ autogen-internal: /go/bin/deepcopy-gen /go/bin/defaulter-gen /go/bin/conversion-
--input-dirs ${API_DIRS} \
-O zz_generated.conversion \
-h /tmp/boilerplate

/go/bin/openapi-gen \
--input-dirs ${API_DIRS} \
--output-package ${PROJECT}/api/openapi \
--report-filename api/openapi/violations.txt \
-h /tmp/boilerplate

# Uncomment this if you'd like to enable OpenAPI generation for the types.
# /go/bin/openapi-gen \
# --input-dirs ${API_DIRS} \
# --output-package ${PROJECT}/api/openapi \
# --report-filename api/openapi/violations.txt \
# -h /tmp/boilerplate

# These commands modify the environment, perform cleanup
$(MAKE) tidy-internal

/go/bin/deepcopy-gen /go/bin/defaulter-gen /go/bin/conversion-gen: /go/bin/%:
go get k8s.io/code-generator/cmd/$*

/go/bin/openapi-gen:
go get k8s.io/kube-openapi/cmd/openapi-gen
# Uncomment this if you'd like to enable OpenAPI generation for the types.
#/go/bin/openapi-gen:
# go get k8s.io/kube-openapi/cmd/openapi-gen

/go/bin/goimports:
go get golang.org/x/tools/cmd/goimports
Expand Down
277 changes: 0 additions & 277 deletions api/openapi/openapi_generated.go

This file was deleted.

Empty file removed api/openapi/violations.txt
Empty file.
Loading