Skip to content

Commit

Permalink
(#1) Project skeleton
Browse files Browse the repository at this point in the history
  • Loading branch information
George Aristy authored and llorllale committed Feb 15, 2019
1 parent 5869b49 commit cad980c
Show file tree
Hide file tree
Showing 11 changed files with 154 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
" goreleaser
dist/

" golangci-lint
bin/

" binary created by "build" recipe
gitlint

" test coverage
coverage.txt
10 changes: 10 additions & 0 deletions .gometalinter.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"Aggregate": true,
"Cyclo": 10,
"EnableAll": true,
"EnableGC": true,
"LineLength": 100,
"Test": true,
"Vendor": true,
"WarnUnmatchedDirective": true
}
39 changes: 39 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# This is an example goreleaser.yaml file with some sane defaults.
# Make sure to check the documentation at http://goreleaser.com
#before:
# hooks:
# # you may remove this if you don't use vgo
# - go mod download
# # you may remove this if you don't need go generate
# - go generate ./...

project_name: go-gitlint
builds:
-
env:
- CGO_ENABLED=0
main: ./cmd/go-gitlint/main.go
binary: gitlint
goos:
- linux
- windows
- darwin
goarch:
- 386
- amd64
archive:
replacements:
darwin: Darwin
linux: Linux
windows: Windows
386: i386
amd64: x86_64
release:
name_template: "{{.Tag}}"
prerelease: auto
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
6 changes: 6 additions & 0 deletions .pdd
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
--source=.
--verbose
--rule min-words:20
--rule min-estimate:0
--rule max-estimate:0

15 changes: 15 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
dist: trusty

language: go
go:
- "1.11.x"

jobs:
include:
- if: type = pull_request
script: make checks &&
bash <(curl -s https://codecov.io/bash)
- if: tag IS present
make checks &&
bash <(curl -s https://codecov.io/bash) &&
make release
40 changes: 40 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#
# Copyright 2019 George Aristy
#
# 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.
#

#
# Supported Targets:
#
# build: builds the binary
# test: runs tests
# lint: runs linters
# checks: runs build+test+lint
# release: releases to GitHub (requires GitHub token)
#

build:
go build -o gitlint cmd/go-gitlint/main.go

test:
go test -count=1 -race -cover -coverprofile=coverage.txt -covermode=atomic ./...

lint:
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s v1.14.0
./bin/golangci-lint run

checks: build lint test

release:
./release.sh
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
[![Release](https://img.shields.io/github/release/llorllale/go-gitlint.svg?style=flat-square)](https://github.com/llorllale/go-gitlint/releases/latest)
[![codecov](https://codecov.io/gh/llorllale/go-gitlint/branch/master/graph/badge.svg)](https://codecov.io/gh/llorllale/go-gitlint)
[![Go Report Card](https://goreportcard.com/badge/github.com/llorllale/go-gitlint?style=flat-square)](https://goreportcard.com/report/github.com/llorllale/go-gitlint)
[![Go Doc](https://img.shields.io/badge/godoc-reference-blue.svg?style=flat-square)](http://godoc.org/github.com/llorllale/go-gitlint)

# go-gitlint
Go lint your commit messages!

Expand Down
5 changes: 5 additions & 0 deletions cmd/go-gitlint/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package main

func main() {
panic("TODO - not yet implemented")
}
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module github.com/llorllale/go-gitlint
Empty file added go.sum
Empty file.
22 changes: 22 additions & 0 deletions release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#
# Copyright 2019 George Aristy
#
# 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.
#

docker run --rm --privileged \
-v $PWD:/go/src/github.com/user/repo \
-v /var/run/docker.sock:/var/run/docker.sock \
-w /go/src/github.com/user/repo \
-e GITHUB_TOKEN \
goreleaser/goreleaser:v0.101-cgo release

0 comments on commit cad980c

Please sign in to comment.