Skip to content

Commit

Permalink
Import CheckDoc tool from Core repo, add it in workflow check and rem…
Browse files Browse the repository at this point in the history
…ove the old one from unit test (#2698)
  • Loading branch information
mxiamxia authored Mar 16, 2021
1 parent e661ccb commit 14b484e
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 52 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ jobs:
command: make -j2 for-all-target TARGET=lint
- run:
name: Checks
command: make -j4 checklicense impi misspell
command: make -j4 checklicense checkdoc impi misspell
- run:
name: Codegen
command: |
Expand Down
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ BUILD_X2=-X $(BUILD_INFO_IMPORT_PATH).Version=$(VERSION)
BUILD_X3=-X go.opentelemetry.io/collector/internal/version.BuildType=$(BUILD_TYPE)
BUILD_INFO=-ldflags "${BUILD_X1} ${BUILD_X2} ${BUILD_X3}"

COMP_REL_PATH=cmd/otelcontribcol/components.go
MOD_NAME=github.com/open-telemetry/opentelemetry-collector-contrib

# ALL_MODULES includes ./* dirs (excludes . dir and example with go code)
ALL_MODULES := $(shell find . -type f -name "go.mod" -exec dirname {} \; | sort | egrep '^./' )

Expand Down Expand Up @@ -144,6 +147,7 @@ install-tools:
cd $(TOOLS_MOD_DIR) && go install github.com/tcnksm/ghr
cd $(TOOLS_MOD_DIR) && go install go.opentelemetry.io/collector/cmd/mdatagen
cd $(TOOLS_MOD_DIR) && go install go.opentelemetry.io/collector/cmd/issuegenerator
cd $(TOOLS_MOD_DIR) && go install go.opentelemetry.io/collector/cmd/checkdoc

.PHONY: run
run:
Expand Down Expand Up @@ -239,3 +243,8 @@ build-examples:
$(MAKE) otelcontribcol-linux_$(ARCH)
docker build -t otelcontribcol-fpm internal/buildscripts/packaging/fpm
docker run --rm -v $(CURDIR):/repo -e PACKAGE=$* -e VERSION=$(VERSION) -e ARCH=$(ARCH) otelcontribcol-fpm

# Verify existence of READMEs for components specified as default components in the collector.
.PHONY: checkdoc
checkdoc:
checkdoc --project-path $(CURDIR) --component-rel-path $(COMP_REL_PATH) --module-name $(MOD_NAME)
2 changes: 1 addition & 1 deletion Makefile.Common
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ all-srcs:
.DEFAULT_GOAL := common

.PHONY: common
common: checklicense impi lint misspell
common: checklicense checkdoc impi lint misspell

.PHONY: test
test:
Expand Down
50 changes: 0 additions & 50 deletions internal/docs_test.go

This file was deleted.

2 changes: 2 additions & 0 deletions internal/tools/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ require (
github.com/tcnksm/ghr v0.13.0
go.opentelemetry.io/collector/cmd/issuegenerator v0.22.0
go.opentelemetry.io/collector/cmd/mdatagen v0.20.0
go.opentelemetry.io/collector/cmd/checkdoc v0.0.0-20210315221557-cadd84d04ee9

)
2 changes: 2 additions & 0 deletions internal/tools/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,8 @@ go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opentelemetry.io/collector/cmd/checkdoc v0.0.0-20210315221557-cadd84d04ee9 h1:mpkc05chK6WjMzhq3ytkR+vaYL1ET/PQ3+c3mTwwQ/4=
go.opentelemetry.io/collector/cmd/checkdoc v0.0.0-20210315221557-cadd84d04ee9/go.mod h1:ocXcey1UOABwvbGLqOrCPY5TDxEV+T5XW4KoEicDZfs=
go.opentelemetry.io/collector/cmd/issuegenerator v0.22.0 h1:iPEvA0bH3iPDlugv0CjXkl5t1fpko1ZEnmDRBdtw/bM=
go.opentelemetry.io/collector/cmd/issuegenerator v0.22.0/go.mod h1:RAUZ03z9JaCu9D+ox5p7LDcv/d4D02EiBJg0sOOzoVY=
go.opentelemetry.io/collector/cmd/mdatagen v0.20.0 h1:xxCYRdc2JybPBO13x5jZ5JxUbAxPAk0y4E3UBVAllyI=
Expand Down
1 change: 1 addition & 0 deletions internal/tools/tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (
_ "github.com/jstemmer/go-junit-report"
_ "github.com/pavius/impi/cmd/impi"
_ "github.com/tcnksm/ghr"
_ "go.opentelemetry.io/collector/cmd/checkdoc"
_ "go.opentelemetry.io/collector/cmd/issuegenerator"
_ "go.opentelemetry.io/collector/cmd/mdatagen"
)

0 comments on commit 14b484e

Please sign in to comment.