Skip to content
Permalink
Browse files

Fixed Package/Imports after repo rename (#11)

* Fixed and cleaned up package/imports
* Updated Makefile - added fmt, lint, updated test
* Updated CircleCI to run parallel builds

Signed-off-by: David Deal <dealako@gmail.com>
  • Loading branch information...
dealako committed Jul 8, 2019
1 parent fde46ce commit 9ab211692b42209bbb0e6e918140e0fc9380428d
@@ -15,34 +15,41 @@ jobs:
command: sudo apt-get install -y awscli
- run:
name: make setup
command: cd cla-backend && make setup_circle
- run:
name: List working dir
command: ls
- run:
name: Copy Workspace To Avoid Conflicts
command: mv ~/project ~/backend
- persist_to_workspace:
root: ~/
paths:
- backend/package.json
- backend/cla-backend
- backend/scripts
- backend/project-vars.yml
command: |
cd cla-backend
make setup_circle
buildGoBackend:
docker:
- image: circleci/golang:1.11
working_directory: /go/src/github.com/communitybridge/easy-cla/
working_directory: /go/src/github.com/communitybridge/easycla/
steps:
- checkout
- run: go get -u github.com/go-swagger/go-swagger/cmd/swagger
- run: cd cla-backend-go; make swagger; make build_aws_lambda
- run: mv cla-backend-go ~/cla-backend-go
- persist_to_workspace:
root: ~/
paths:
- cla-backend-go/backend_aws_lambda
- run:
name: Setup
command: |
cd cla-backend-go
make setup_dev
- run:
name: Build Swagger
command: |
cd cla-backend-go
make swagger
- run:
name: Build
command: |
cd cla-backend-go
make build_aws_lambda
- run:
name: Test
command: |
cd cla-backend-go
make test
#- run:
# name: Lint
# command: |
# cd cla-backend-go
# make lint

buildUIProject: &buildUIAnchor
docker:
@@ -55,13 +62,6 @@ jobs:
- run:
name: Install Dependencies
command: cd $PROJECT_DIR && make setup
- run:
name: Copy Workspace To Avoid Conflicts
command: mv /home/circleci/project "/home/circleci/$PROJECT_DIR-workspace"
- persist_to_workspace:
root: ~/
paths:
- ./*

buildProjectManagementConsole:
<<: *buildUIAnchor
@@ -87,27 +87,18 @@ workflows:
tags:
only: /.*/
- buildGoBackend:
requires:
- buildBackend
filters:
tags:
only: /.*/
- buildProjectManagementConsole:
requires:
- buildBackend
- buildGoBackend
filters:
tags:
only: /.*/
- buildCorporateManagementConsole:
requires:
- buildProjectManagementConsole
filters:
tags:
only: /.*/
- buildContributorConsole:
requires:
- buildCorporateManagementConsole
filters:
tags:
only: /.*/
@@ -11,7 +11,9 @@ db/schema.sql
!.vscode/launch.json
!.vscode/extensions.json

# Ignore Jetbrains IDE configuration files
.idea/*
*.iml

# Serverless directories
.serverless
@@ -27,4 +29,8 @@ vendor

.env

gen
# Ignore the generated folder
gen/

# Ignore test reports
cover.out
@@ -0,0 +1,84 @@
# More info on config here: https://github.com/golangci/golangci-lint#config-file
run:
deadline: 5m
issues-exit-code: 1
tests: true
skip-dirs:
- .git
- bin
- vendor
- node_modules
- var
- gen
- tmp
skip-files:
- \.pb\.go$
- \.pb\.goclay\.go$

output:
format: colored-line-number
print-issued-lines: true
print-linter-name: true

linters-settings:
errcheck:
# report about not checking of errors in type assetions: `a := b.(MyStruct)`;
# default is false: such cases aren't reported by default.
check-type-assertions: true

# report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`;
# default is false: such cases aren't reported by default.
check-blank: true
govet:
check-shadowing: true
golint:
min-confidence: 0
dupl:
threshold: 100
goconst:
min-len: 2
min-occurrences: 2
maligned:
# print struct with more effective memory layout or not, false by default
suggest-new: true

linters:
disable-all: true
enable:
- golint
- govet
- errcheck
- deadcode
- structcheck
- varcheck
- ineffassign
- typecheck
- goconst
- gocyclo
- gofmt
- goimports
- gosec
- megacheck # (staticcheck + gosimple + unused in one linter)
- depguard
- unconvert
- unparam
- unused
- nakedret
- maligned
#- dupl

issues:
exclude-use-default: false
exclude:
# _ instead of err checks
- G104
# for "public interface + private struct implementation" cases only!
- exported func * returns unexported type *, which can be annoying to use
# can be removed in the development phase
# - (comment on exported (method|function|type|const)|should have( a package)? comment|comment should be of the form)
# not for the active development - can be removed in the stable phase
- should have a package comment, unless it's in another file for this package
- don't use an underscore in package name
# errcheck: Almost all programs ignore errors on these functions and in most cases it's ok
- Error return value of .((os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*printf?|os\.(Un)?Setenv|.*Rollback). is not checked
- should check returned error before deferring

0 comments on commit 9ab2116

Please sign in to comment.
You can’t perform that action at this time.