Skip to content

Commit 65bbeae

Browse files
songy23bogdandrutu
authored andcommitted
Add Makefile and Travis CI build (open-telemetry#200)
* Add Makefile and Travis CI build * Simplify the script * Add to contributing guideline * Include Go modules and tools.go * Remove new line at eof
1 parent c996f8a commit 65bbeae

File tree

6 files changed

+88
-0
lines changed

6 files changed

+88
-0
lines changed

.travis.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
language: go
2+
cache:
3+
directories:
4+
- /home/travis/gopath/pkg/mod
5+
6+
go:
7+
- 1.12.x
8+
9+
env:
10+
global:
11+
GO111MODULE=on
12+
13+
install:
14+
- make install-tools
15+
16+
script:
17+
- make travis-ci

CONTRIBUTING.md

+16
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,19 @@ We highly encourage to use line breaks in markdown files at `80` characters
1919
wide. There are tools that can do it for you effectively. Please submit proposal
2020
to include your editor settings required to enable this behavior so the out of
2121
the box settings for this repository will be consistent.
22+
23+
In addition, please make sure to clean up typos before you submit the change.
24+
25+
To check for typos, use
26+
27+
```bash
28+
# Golang is needed for the misspell tool.
29+
make install-tools
30+
make misspell
31+
```
32+
33+
To quickly fix typos, use
34+
35+
```bash
36+
make misspell-correction
37+
```

Makefile

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# All documents to be used in spell check.
2+
ALL_DOC := $(shell find . -name '*.md' -type f | sort)
3+
4+
MISSPELL=misspell -error
5+
MISSPELL_CORRECTION=misspell -w
6+
7+
.PHONY: travis-ci
8+
travis-ci: misspell
9+
10+
.PHONY: misspell
11+
misspell:
12+
$(MISSPELL) $(ALL_DOC)
13+
14+
.PHONY: misspell-correction
15+
misspell-correction:
16+
$(MISSPELL_CORRECTION) $(ALL_DOC)
17+
18+
.PHONY: install-tools
19+
install-tools:
20+
GO111MODULE=on go install \
21+
github.com/client9/misspell/cmd/misspell

go.mod

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module github.com/open-telemetry/opentelemetry-specification
2+
3+
go 1.12
4+
5+
require github.com/client9/misspell v0.3.4

go.sum

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
github.com/client9/misspell v0.3.4 h1:ta993UF76GwbvJcIo3Y68y/M3WxlpEHPWIGDkJYwzJI=
2+
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=

internal/tools.go

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// Copyright 2019, OpenTelemetry Authors
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
//
15+
16+
// +build tools
17+
18+
package internal
19+
20+
// This file follows the recommendation at
21+
// https://github.com/golang/go/wiki/Modules#how-can-i-track-tool-dependencies-for-a-module
22+
// on how to pin tooling dependencies to a go.mod file.
23+
// This ensures that all systems use the same version of tools in addition to regular dependencies.
24+
25+
import (
26+
_ "github.com/client9/misspell/cmd/misspell"
27+
)

0 commit comments

Comments
 (0)