* Generate and build before linting
Generated files may require some formatting that happens during
linting. Also missing generated files may result in linter failures.
Building can shake out any syntax/semantic errors and report them in a
much nicer way than the linter does. Which is exactly the reason the
build was running before linters before the Makefile simplification.
* Make stringer tool a dep of generate target, not lint
Lint target does not use the stringer utility - it is being used by go
generate.
* Simplify Makefile
In particular, this change:
* Ensures that the race checker is always used for all tests
* Removes redundant commands
* Splits out `generate` and `lint` as their own commands
* Renames the `circle-ci` command to the more generic `ci`
* Use GOTEST_WITH_COVERAGE instead of old name
* Fix test-with-coverage command
* Fix test-386 command
golangci-lint runs its checks also on tests files, so make sure that
they build properly before running the linter. there is no obvious
solution to just build all the test without running them, so to work
that around, we specify a -run flag with a value that surely isn't
going to match any test function any time soon. that way we build all
the tests, but no test is run.
also, `go list ./...` returns only packages in the module, but no
packages within submodule, so exporter/trace/jaeger (which is a
submodule) was never on the list. so go test with those packages never
ran the jaeger trace exporter tests. fix this by visiting every
directory with the go.mod file and calling go test [options]
./... therein.
golangci-lint just issues an unreadable warning and quits with a
successful exit status on compilation error. just run a round of go
build ./... to catch those as hard errors.
* automate building all the examples
the EXAMPLES variable was out of date - the stackdriver example wasn't
even built
let's automate it, so we don't need to remember about updating the
variable after adding a new example to the examples directory
* move jaeger example to example directory
this should be in the examples directory, so it can be built by the
make test during CI.
* switch to go 1.13
circle ci uses go 1.12 (which is the oldest 1.12 release) that
contains some bugs with module handling
let's switch to go 1.13.3, the latest go currently
* use a single valid revision of the project in go.mod files
this probably shouldn't be a problem since the switch to go 1.13 in
circle ci, but cleans up the mess and the use of bogus releases
* Add a document about contributing
It is shamelessly stolen from opentelemetry-python and edited to be
relevant to opentelemetry-go. This file should explain some less
obvious things about the development of the project, like running
linters and regenerating the files.
* Force the use of go modules
Until go 1.13 modules were disabled by default if the repository was
inside GOPATH. This was causing issues when running `make precommit`
for the first time, as it could not find sources for any of the tools
used in `make precommit` under `${GOPATH}/src`. With setting the
`GO111MODULE` environment variable to `on`, we tell `go` to behave
differently, just like go 1.13 does by default.
* Remove globals from exp/streaming
* basic example
* Build the streaming example
* Update README.md for running streaming example
* Remove observer package
* Move observer to exporter
* Fix
* Re-run make circle-ci
* Run go generate in the precommit target
So we should always get an updated version of a file generated by a
stringer utility.
* Update the generated file
* Make CI to fail if working tree has uncommited changes
The uncommitted changes may come from the golang linter (that formats
our code among other things) and from stringer (when updated some
enumeration).
Enabling misspell and goimports in golangci-lint allows a bit of
simplification of tools.go / Makefile.
The linters enabled locally also complained about the markdown in
README.md a little, so I fixed those complaints.
I also enabled auto-fix mode in golangci-lint so that it will just
fix any lint issues it runs across (which is how goimports/misspell)
was being used.
misspell still needs to be included in tools.go unless we decide that
we didn't want it to run on markdown files.
* fix compile errors.
* fix lint errors.
* add circle-ci job.
* rename IDHigh to TraceIDHigh
* rename the file.
* add go get for goimports and golangci-lint
* enable GO111MODULE and remove comments.
* remove working dir and update cache name
* Add TEST_RESULT env back.
* run go mod tidy.
* remove go mod download.
* add test coverage.
* fix TraceID.
* fix circlefi config error.
* remove install-tools.
* remove ALL_TEST_SRC from Makefile.
goimports for import rewritting
golangci-lint as the configurable linting swiss army knife.
These tools are recorded in [tools.go](https://github.com/golang/go/wiki/Modules#how-can-i-track-tool-dependencies-for-a-module). This records
them as a dependency to make sure we're all using the same tool versions.
To make sure this project's tool's versions don't stomp over versions
from other projects, they are installed in ./.tools, which is
.gitignored.
goimports was run and fixed up a single file:
plugin/httptrace/httptrace.go
I prefer to group local packages below external packages, hence the use
of goimports -local option.
.golangci.yml contains nothing but an incomplete set of defaults ATM.
I expect those to change over time though. ;-)
To use, run:
$ make precommit
Fixes#15