Skip to content
Merged
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
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[*]
indent_style = tab
indent_size = 4

[*.yml]
indent_style = space
indent_size = 2

[*.yaml]
indent_style = space
indent_size = 2

[Makefile]
indent_style = tab
indent_size = 4
3 changes: 2 additions & 1 deletion cmd/helpers/projectHelper.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ func (h *projectHelper) InitProject(project models.Project) error {
{TemplatePath: "templates/Makefile.tmpl", Destination: "/Makefile"},
{TemplatePath: "templates/go.tmpl", Destination: "/go.mod"},
{TemplatePath: "templates/main.tmpl", Destination: "/main.go"},
{TemplatePath: "templates/editorconfig.tmpl", Destination: "/.editorconfig"},
{TemplatePath: "templates/instance/instance.tmpl", Destination: "/instance/instance.go"},
{TemplatePath: "templates/app/init.tmpl", Destination: "/app/init.go"},
}
Expand Down Expand Up @@ -110,7 +111,7 @@ func (h *projectHelper) CreategRPCAPI(project models.Project) error {
{TemplatePath: "templates/app/grpc/handlers/health.tmpl", Destination: "/app/grpc/handlers/health.go"},
{TemplatePath: "templates/app/grpc/proto/health.proto", Destination: "/app/grpc/proto/health.proto"},
{TemplatePath: "templates/app/grpc/proto/health.pb.tmpl", Destination: "/app/grpc/proto/health.pb.go"},
{TemplatePath: "templates/app/grpc/proto/health_grpc.pb.tmpl", Destination: "/app/grpc/proto/health_hrpc.pb.go"},
{TemplatePath: "templates/app/grpc/proto/health_grpc.pb.tmpl", Destination: "/app/grpc/proto/health_grpc.pb.go"},
{TemplatePath: "templates/app/grpc/router/router.tmpl", Destination: "/app/grpc/router/router.go"},
{TemplatePath: "templates/runner/grpc.tmpl", Destination: "/runner/grpc.go"},
}
Expand Down
10 changes: 10 additions & 0 deletions templates/Makefile.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@ endif
test:
go test -v ./... -race -coverprofile=coverage.out -covermode=atomic

coverage: test
go tool cover -func=coverage.out

coverage-html: test
mkdir -p coverage
go tool cover -html=coverage.out -o coverage/index.html

coverage-serve: coverage-html
python3 -m http.server 8080 -d coverage

setup:
go mod tidy

Expand Down
2 changes: 2 additions & 0 deletions templates/docker/Dockerfile.debug
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,6 @@ RUN set -x && \

WORKDIR /app

RUN go install github.com/go-delve/delve/cmd/dlv@latest

ENTRYPOINT ["modd", "-f", "./docker/modd-debug.conf"]
4 changes: 2 additions & 2 deletions templates/docker/modd-debug.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
prep: if pgrep $APP_NAME; then pkill $APP_NAME; fi
prep: if pgrep dlv; then pkill dlv; fi
prep: go mod tidy
prep: go build -gcflags="-N -l" -o $APP_NAME ./*.go
prep: go build -gcflags="all=-N -l" -o $APP_NAME ./*.go
daemon: ./$APP_NAME start
daemon: dlv attach --headless=true --listen=:2345 --api-version=2 $(pidof $BIN_NAME)
daemon: dlv attach --headless=true --listen=:2345 --api-version=2 $(pidof $APP_NAME)
}
15 changes: 15 additions & 0 deletions templates/editorconfig.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[*]
indent_style = tab
indent_size = 4

[*.yml]
indent_style = space
indent_size = 2

[*.yaml]
indent_style = space
indent_size = 2

[Makefile]
indent_style = tab
indent_size = 4
7 changes: 6 additions & 1 deletion templates/gitignore.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Files
{{.AppName}}
{{.AppName}}.exe
.env
.db
modd/
coverage.out


# Directory
coverage/