Skip to content
This repository has been archived by the owner on Mar 4, 2022. It is now read-only.

Promote cmd out of internal #217

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
18 changes: 9 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
/cover
/cover.html
/coverage.txt
/internal/cmd/gen-prototool-bash-completion/gen-prototool-bash-completion
/internal/cmd/gen-prototool-zsh-completion/gen-prototool-zsh-completion
/internal/cmd/gen-prototool-manpages/gen-prototool-manpages
/internal/cmd/prototool/prototool
/internal/cmd/testdata/create/one/a/b/bar/baz.proto
/internal/cmd/testdata/create/one/a/c/bar/baz.proto
/internal/cmd/testdata/create/one/b/c/bar/baz.proto
/internal/cmd/testdata/create/one/baz.proto
/internal/cmd/testdata/create/two/baz.proto
/cmd/gen-prototool-bash-completion/gen-prototool-bash-completion
/cmd/gen-prototool-zsh-completion/gen-prototool-zsh-completion
/cmd/gen-prototool-manpages/gen-prototool-manpages
/cmd/prototool/prototool
/cmd/internal/testdata/create/one/a/b/bar/baz.proto
/cmd/internal/testdata/create/one/a/c/bar/baz.proto
/cmd/internal/testdata/create/one/b/c/bar/baz.proto
/cmd/internal/testdata/create/one/baz.proto
/cmd/internal/testdata/create/two/baz.proto
/main
/prototool.iml
/release
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]
- No changes yet.
### Added
- Move `internal/cmd` to `cmd/` so that it can be depended on.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

super nitty:

Move `internal/cmd` to `cmd/` so that `prototool` can be imported by other projects.



## [1.2.0] - 2018-08-29
Expand Down
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
SRCS := $(shell find . -name '*.go' | grep -v ^\.\/vendor\/ | grep -v ^\.\/example\/ | grep -v \/gen\/grpcpb\/)
PKGS := $(shell go list ./... | grep -v github.com\/uber\/prototool\/example | grep -v \/gen\/grpcpb)
BINS := github.com/uber/prototool/internal/cmd/prototool
BINS := github.com/uber/prototool/cmd/prototool

DOCKER_IMAGE := golang:1.10.3

Expand Down Expand Up @@ -35,16 +35,16 @@ license:

.PHONY: golden
golden: install
for file in $(shell find internal/cmd/testdata/format -name '*.proto.golden'); do \
for file in $(shell find cmd/internal/testdata/format -name '*.proto.golden'); do \
rm -f $${file}; \
done
for file in $(shell find internal/cmd/testdata/format -name '*.proto'); do \
for file in $(shell find cmd/internal/testdata/format -name '*.proto'); do \
prototool format $${file} > $${file}.golden || true; \
done
for file in $(shell find internal/cmd/testdata/format-fix -name '*.proto.golden'); do \
for file in $(shell find cmd/internal/testdata/format-fix -name '*.proto.golden'); do \
rm -f $${file}; \
done
for file in $(shell find internal/cmd/testdata/format-fix -name '*.proto'); do \
for file in $(shell find cmd/internal/testdata/format-fix -name '*.proto'); do \
prototool format --fix $${file} > $${file}.golden || true; \
done

Expand All @@ -65,7 +65,7 @@ example: install

.PHONY: internalgen
internalgen: install
prototool generate internal/cmd/testdata/grpc
prototool generate cmd/internal/testdata/grpc
rm -f etc/config/example/prototool.yaml
prototool config init etc/config/example --uncomment

Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/cmd.go → cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

// Package cmd contains the logic to setup Prototool with github.com/spf13/cobra.
//
// The packages internal/cmd/prototool, internal/gen/gen-prototool-bash-completion,
// The packages cmd/prototool, internal/gen/gen-prototool-bash-completion,
// internal/gen/gen-prototool-manpages and internal/gen/gen-prototool-zsh-completion
// are main packages that call into this package, and this package calls into
// internal/exec to execute the logic.
Expand Down
Loading