Skip to content

Commit

Permalink
cocli: move cocli to a standalone repo
Browse files Browse the repository at this point in the history
Relocate cocli to a separate repo under Veraison Organization. Preserve
git history during the process.

cocli will be available at https://github.com/veraison/cocli

Signed-off-by: Jagannathan Raman <[email protected]>
  • Loading branch information
jraman567 authored and thomas-fossati committed Aug 27, 2024
1 parent be7ec48 commit de149e9
Show file tree
Hide file tree
Showing 103 changed files with 9 additions and 5,438 deletions.
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,3 @@
# vendor/

mocks/

# Generated during testing
cocli/cocli
cocli/cmd/output.cbor
30 changes: 6 additions & 24 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,9 @@ GO111MODULE := on
GOPKG := github.com/veraison/corim/corim
GOPKG += github.com/veraison/corim/comid
GOPKG += github.com/veraison/corim/cots
GOPKG += github.com/veraison/corim/cocli/cmd
GOPKG += github.com/veraison/corim/encoding
GOPKG += github.com/veraison/corim/extensions

MOCKGEN := $(shell go env GOPATH)/bin/mockgen
INTERFACES := cocli/cmd/isubmitter.go
MOCKPKG := mocks

GOLINT ?= golangci-lint

ifeq ($(MAKECMDGOALS),lint)
Expand All @@ -26,7 +21,8 @@ else
endif

.PHONY: lint lint-extra
lint lint-extra: _mocks; $(GOLINT) $(GOLINT_ARGS)
lint lint-extra:
$(GOLINT) $(GOLINT_ARGS)

ifeq ($(MAKECMDGOALS),test)
GOTEST_ARGS ?= -v -race $(GOPKG)
Expand All @@ -38,28 +34,14 @@ endif

COVER_THRESHOLD := $(shell grep '^name: cover' .github/workflows/ci-go-cover.yml | cut -c13-)


define MOCK_template
mock_$(1): $(1)
$$(MOCKGEN) -source=$$< -destination=cocli/cmd/mocks/$$$$(basename $$@) -package=$$(MOCKPKG)
endef

$(foreach m,$(INTERFACES),$(eval $(call MOCK_template,$(m))))
MOCK_FILES := $(foreach m,$(INTERFACES),$(join mock_,$(m)))
CLEANFILES := $(MOCK_FILES)

_mocks: $(MOCK_FILES)
.PHONY: _mocks

.PHONY: test test-cover
test test-cover: _mocks; go test $(GOTEST_ARGS)
test test-cover:
go test $(GOTEST_ARGS)

realtest: _mocks; go test $(GOTEST_ARGS)
realtest:
go test $(GOTEST_ARGS)
.PHONY: realtest

.PHONY: clean
clean: ; $(RM) $(CLEANFILES)

presubmit:
@echo
@echo ">>> Check that the reported coverage figures are $(COVER_THRESHOLD)"
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ The [`corim/corim`](corim) and [`corim/comid`](comid) packages provide a golang
> These API are still in active development (as is the underlying CoRIM spec).
> They are **subject to change** in the future.
The [`corim/cocli`](cocli) package uses the API above (as well as the API from [`veraison/swid`](https://github.com/veraison/swid) package) to provide a user friendly command line interface for working with CoRIM, CoMID, CoSWID and CoTS. Specifically it allows creating, signing, verifying, displaying, uploading, and more. See [`cocli/README.md`](cocli/README.md) for further details.

## Developer tips

Before requesting a PR (and routinely during the dev/test cycle), you are encouraged to run:
Expand Down
Loading

0 comments on commit de149e9

Please sign in to comment.