Skip to content

Commit

Permalink
Add Makefile and Travis CI build (#200)
Browse files Browse the repository at this point in the history
* Add Makefile and Travis CI build

* Simplify the script

* Add to contributing guideline

* Include Go modules and tools.go

* Remove new line at eof
  • Loading branch information
songy23 authored and bogdandrutu committed Aug 6, 2019
1 parent c996f8a commit 65bbeae
Show file tree
Hide file tree
Showing 6 changed files with 88 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
language: go
cache:
directories:
- /home/travis/gopath/pkg/mod

go:
- 1.12.x

env:
global:
GO111MODULE=on

install:
- make install-tools

script:
- make travis-ci
16 changes: 16 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,19 @@ We highly encourage to use line breaks in markdown files at `80` characters
wide. There are tools that can do it for you effectively. Please submit proposal
to include your editor settings required to enable this behavior so the out of
the box settings for this repository will be consistent.

In addition, please make sure to clean up typos before you submit the change.

To check for typos, use

```bash
# Golang is needed for the misspell tool.
make install-tools
make misspell
```

To quickly fix typos, use

```bash
make misspell-correction
```
21 changes: 21 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# All documents to be used in spell check.
ALL_DOC := $(shell find . -name '*.md' -type f | sort)

MISSPELL=misspell -error
MISSPELL_CORRECTION=misspell -w

.PHONY: travis-ci
travis-ci: misspell

.PHONY: misspell
misspell:
$(MISSPELL) $(ALL_DOC)

.PHONY: misspell-correction
misspell-correction:
$(MISSPELL_CORRECTION) $(ALL_DOC)

.PHONY: install-tools
install-tools:
GO111MODULE=on go install \
github.com/client9/misspell/cmd/misspell
5 changes: 5 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module github.com/open-telemetry/opentelemetry-specification

go 1.12

require github.com/client9/misspell v0.3.4
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github.com/client9/misspell v0.3.4 h1:ta993UF76GwbvJcIo3Y68y/M3WxlpEHPWIGDkJYwzJI=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
27 changes: 27 additions & 0 deletions internal/tools.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Copyright 2019, OpenTelemetry Authors
//
// 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.
//

// +build tools

package internal

// This file follows the recommendation at
// https://github.com/golang/go/wiki/Modules#how-can-i-track-tool-dependencies-for-a-module
// on how to pin tooling dependencies to a go.mod file.
// This ensures that all systems use the same version of tools in addition to regular dependencies.

import (
_ "github.com/client9/misspell/cmd/misspell"
)

0 comments on commit 65bbeae

Please sign in to comment.