Skip to content

Commit

Permalink
Merge pull request #66 from create-go-app/dev
Browse files Browse the repository at this point in the history
Fix golangci-lint issues
  • Loading branch information
Vic Shóstak authored Apr 18, 2021
2 parents 4a727e6 + f9fb600 commit f000c1b
Show file tree
Hide file tree
Showing 18 changed files with 74 additions and 272 deletions.
1 change: 0 additions & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# These are supported funding model platforms

github: koddr
patreon: koddr
custom: https://paypal.me/koddr
22 changes: 22 additions & 0 deletions .github/workflows/golangci_lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Linting

on:
push:
branches:
- dev
pull_request:
branches:
- master

jobs:
golangci:
name: Linting Go code

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: latest
7 changes: 4 additions & 3 deletions .github/workflows/testing_build.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
name: Testing CLI
name: Testing

on:
push:
branches: [dev]
branches:
- dev
paths:
- "**.go"

jobs:
build:
testing:
name: Testing build

strategy:
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2019-present Vic Shóstak <[email protected]> (https://1wa.co)
Copyright 2019-present Vic Shóstak <[email protected]> (https://shostak.dev)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ test: clean
go test -coverprofile=coverage.out ./...
go tool cover -func=coverage.out

lint:
golangci-lint run

security:
gosec -quiet ./...

install: security test
install: security lint test
CGO_ENABLED=0 go build -ldflags="-s -w" -o $(GOPATH)/bin/cgapp main.go

build: security test
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
</h1>
<p align="center">Create a new production-ready project with <b>backend</b> (Golang), <b>frontend</b> (JavaScript, TypeScript)<br/>and <b>deploy automation</b> (Ansible, Docker) by running one CLI command.<br/><br/>Focus on <b>writing</b> code and <b>thinking</b> of business-logic! The CLI will take care of the rest.</p>

<p align="center"><a href="https://github.com/create-go-app/cli/releases" target="_blank"><img src="https://img.shields.io/badge/version-v1.7.4-blue?style=for-the-badge&logo=none" alt="cli version" /></a>&nbsp;<a href="https://pkg.go.dev/github.com/create-go-app/cli?tab=doc" target="_blank"><img src="https://img.shields.io/badge/Go-1.16+-00ADD8?style=for-the-badge&logo=go" alt="go version" /></a>&nbsp;<a href="https://gocover.io/github.com/create-go-app/cli/pkg/cgapp" target="_blank"><img src="https://img.shields.io/badge/Go_Cover-94%25-success?style=for-the-badge&logo=none" alt="go cover" /></a>&nbsp;<a href="https://goreportcard.com/report/github.com/create-go-app/cli" target="_blank"><img src="https://img.shields.io/badge/Go_report-A+-success?style=for-the-badge&logo=none" alt="go report" /></a>&nbsp;<img src="https://img.shields.io/badge/license-apache_2.0-red?style=for-the-badge&logo=none" alt="license" /></p>
<p align="center"><a href="https://github.com/create-go-app/cli/releases" target="_blank"><img src="https://img.shields.io/badge/version-v1.7.5-blue?style=for-the-badge&logo=none" alt="cli version" /></a>&nbsp;<a href="https://pkg.go.dev/github.com/create-go-app/cli?tab=doc" target="_blank"><img src="https://img.shields.io/badge/Go-1.16+-00ADD8?style=for-the-badge&logo=go" alt="go version" /></a>&nbsp;<a href="https://gocover.io/github.com/create-go-app/cli/pkg/cgapp" target="_blank"><img src="https://img.shields.io/badge/Go_Cover-94%25-success?style=for-the-badge&logo=none" alt="go cover" /></a>&nbsp;<a href="https://goreportcard.com/report/github.com/create-go-app/cli" target="_blank"><img src="https://img.shields.io/badge/Go_report-A+-success?style=for-the-badge&logo=none" alt="go report" /></a>&nbsp;<img src="https://img.shields.io/badge/license-apache_2.0-red?style=for-the-badge&logo=none" alt="license" /></p>

## ⚡️ Quick start

Expand Down
26 changes: 3 additions & 23 deletions cmd/create.go
Original file line number Diff line number Diff line change
@@ -1,27 +1,7 @@
/*
Package cmd includes all of the Create Go App CLI commands.
// Copyright 2019-present Vic Shóstak. All rights reserved.
// Use of this source code is governed by Apache 2.0 license
// that can be found in the LICENSE file.

Create a new production-ready project with backend (Golang),
frontend (JavaScript, TypeScript) and deploy automation
(Ansible, Docker) by running one CLI command.
-> Focus on writing code and thinking of business logic!
<- The Create Go App CLI will take care of the rest.
Copyright © 2019-present Vic Shóstak <[email protected]> (https://1wa.co)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
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.
*/
package cmd

import (
Expand Down
26 changes: 3 additions & 23 deletions cmd/deploy.go
Original file line number Diff line number Diff line change
@@ -1,27 +1,7 @@
/*
Package cmd includes all of the Create Go App CLI commands.
// Copyright 2019-present Vic Shóstak. All rights reserved.
// Use of this source code is governed by Apache 2.0 license
// that can be found in the LICENSE file.

Create a new production-ready project with backend (Golang),
frontend (JavaScript, TypeScript) and deploy automation
(Ansible, Docker) by running one CLI command.
-> Focus on writing code and thinking of business logic!
<- The Create Go App CLI will take care of the rest.
Copyright © 2019-present Vic Shóstak <[email protected]> (https://1wa.co)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
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.
*/
package cmd

import (
Expand Down
26 changes: 3 additions & 23 deletions cmd/init.go
Original file line number Diff line number Diff line change
@@ -1,27 +1,7 @@
/*
Package cmd includes all of the Create Go App CLI commands.
// Copyright 2019-present Vic Shóstak. All rights reserved.
// Use of this source code is governed by Apache 2.0 license
// that can be found in the LICENSE file.

Create a new production-ready project with backend (Golang),
frontend (JavaScript, TypeScript) and deploy automation
(Ansible, Docker) by running one CLI command.
-> Focus on writing code and thinking of business logic!
<- The Create Go App CLI will take care of the rest.
Copyright © 2019-present Vic Shóstak <[email protected]> (https://1wa.co)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
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.
*/
package cmd

import (
Expand Down
44 changes: 12 additions & 32 deletions cmd/root.go
Original file line number Diff line number Diff line change
@@ -1,27 +1,7 @@
/*
Package cmd includes all of the Create Go App CLI commands.
// Copyright 2019-present Vic Shóstak. All rights reserved.
// Use of this source code is governed by Apache 2.0 license
// that can be found in the LICENSE file.

Create a new production-ready project with backend (Golang),
frontend (JavaScript, TypeScript) and deploy automation
(Ansible, Docker) by running one CLI command.
-> Focus on writing code and thinking of business logic!
<- The Create Go App CLI will take care of the rest.
Copyright © 2019-present Vic Shóstak <[email protected]> (https://1wa.co)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
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.
*/
package cmd

import (
Expand All @@ -35,15 +15,15 @@ import (
)

var (
useConfigFile bool // indicate using config (from $PWD/.cgapp.yml)
projectConfig map[string]interface{} // parse project config
rolesConfig map[string]interface{} // parse Ansible roles config
backend, frontend, webserver, database string // define project variables
installAnsibleRoles, askBecomePass bool // install Ansible roles, ask become pass
username, host, network, port string // define deploy variables
playbook string = "deploy-playbook.yml" // default Ansible playbook
createAnswers registry.CreateAnswers // define answers variable for `create` command
deployAnswers registry.DeployAnswers // define answers variable for `deploy` command
useConfigFile bool // indicate using config (from $PWD/.cgapp.yml)
projectConfig map[string]interface{} // parse project config
rolesConfig map[string]interface{} // parse Ansible roles config
backend, frontend, webserver string // define project variables
installAnsibleRoles, askBecomePass bool // install Ansible roles, ask become pass
username, host, network, port string // define deploy variables
playbook string = "deploy-playbook.yml" // default Ansible playbook
createAnswers registry.CreateAnswers // define answers variable for `create` command
deployAnswers registry.DeployAnswers // define answers variable for `deploy` command

// Config for survey icons and colors.
// See: https://github.com/mgutz/ansi#style-format
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ frontend (JavaScript, TypeScript) and deploy automation
A helpful documentation and next steps -> https://create-go.app/
Copyright © 2019-present Vic Shóstak <[email protected]> (https://1wa.co)
Copyright (c) 2019-present Vic Shóstak <[email protected]> (https://shostak.dev)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
34 changes: 3 additions & 31 deletions pkg/cgapp/create.go
Original file line number Diff line number Diff line change
@@ -1,29 +1,7 @@
/*
Package cgapp includes a powerful CLI for the Create Go App project.
// Copyright 2019-present Vic Shóstak. All rights reserved.
// Use of this source code is governed by Apache 2.0 license
// that can be found in the LICENSE file.

Create a new production-ready project with backend (Golang),
frontend (JavaScript, TypeScript) and deploy automation
(Ansible, Docker) by running one CLI command.
-> Focus on writing code and thinking of business logic!
<- The Create Go App CLI will take care of the rest.
A helpful documentation and next steps -> https://create-go.app/
Copyright © 2019-present Vic Shóstak <[email protected]> (https://1wa.co)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
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.
*/
package cgapp

import (
Expand Down Expand Up @@ -121,14 +99,12 @@ func CreateProjectFromCmd(p *registry.Project, c map[string]*registry.Command, m
if len(project) > 1 {
options = []string{create, folder, args["template"], "cra-template-" + project[1]}
}
break
case "preact":
// preact create [template] [dest] [args...]
options = []string{create, "default", p.Type, args["cwd"], p.RootFolder, args["name"], "cgapp"}
if len(project) > 1 {
options = []string{create, project[1], p.Type, args["cwd"], p.RootFolder, args["name"], "cgapp"}
}
break
case "vue":
// vue create [options] <app-name>
options = []string{create, "--default", "--bare", p.Type}
Expand All @@ -138,22 +114,18 @@ func CreateProjectFromCmd(p *registry.Project, c map[string]*registry.Command, m
if len(project) == 3 {
options = []string{create, "--preset", project[1] + ":" + project[2], "--bare", "--clone", p.Type}
}
break
case "angular":
// ng new <app-name> [options]
options = []string{create, "cgapp", "--defaults", "--routing", "--directory", p.Type}
break
case "svelte":
// npx degit [template] [dest]
options = []string{create, args["template"], folder}
break
case "sapper":
// npx degit [template] [dest]
options = []string{create, args["template"] + "#rollup", folder}
if len(project) > 1 {
options = []string{create, args["template"] + "#" + project[1], folder}
}
break
}

// Run execution command.
Expand Down
28 changes: 3 additions & 25 deletions pkg/cgapp/exec.go
Original file line number Diff line number Diff line change
@@ -1,29 +1,7 @@
/*
Package cgapp includes a powerful CLI for the Create Go App project.
// Copyright 2019-present Vic Shóstak. All rights reserved.
// Use of this source code is governed by Apache 2.0 license
// that can be found in the LICENSE file.

Create a new production-ready project with backend (Golang),
frontend (JavaScript, TypeScript) and deploy automation
(Ansible, Docker) by running one CLI command.
-> Focus on writing code and thinking of business logic!
<- The Create Go App CLI will take care of the rest.
A helpful documentation and next steps -> https://create-go.app/
Copyright © 2019-present Vic Shóstak <[email protected]> (https://1wa.co)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
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.
*/
package cgapp

import (
Expand Down
28 changes: 3 additions & 25 deletions pkg/cgapp/files.go
Original file line number Diff line number Diff line change
@@ -1,29 +1,7 @@
/*
Package cgapp includes a powerful CLI for the Create Go App project.
// Copyright 2019-present Vic Shóstak. All rights reserved.
// Use of this source code is governed by Apache 2.0 license
// that can be found in the LICENSE file.

Create a new production-ready project with backend (Golang),
frontend (JavaScript, TypeScript) and deploy automation
(Ansible, Docker) by running one CLI command.
-> Focus on writing code and thinking of business logic!
<- The Create Go App CLI will take care of the rest.
A helpful documentation and next steps -> https://create-go.app/
Copyright © 2019-present Vic Shóstak <[email protected]> (https://1wa.co)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
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.
*/
package cgapp

import (
Expand Down
Loading

0 comments on commit f000c1b

Please sign in to comment.