File tree 5 files changed +47
-8
lines changed
5 files changed +47
-8
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,8 @@ install:
15
15
- dep ensure
16
16
17
17
script :
18
- - make test
18
+ - make checkdocs
19
+ - make test
19
20
20
21
after_success :
21
22
- bash <(curl -s https://codecov.io/bash)
Original file line number Diff line number Diff line change
1
+ # Contributing
2
+
3
+ We would love to have people submit pull requests and help make ` grpc-ecosystem/go-grpc-middleware ` even better 👍.
4
+
5
+ Fork, then clone the repo:
6
+
7
+ ``` bash
8
+ git clone
[email protected] :your-username/go-grpc-middleware.git
9
+ ```
10
+
11
+ Before checking in please run the following:
12
+
13
+ ``` bash
14
+ make all
15
+ ```
16
+
17
+ This will ` vet ` , ` fmt ` , regenerate documentation and run all tests.
18
+
19
+
20
+ Push to your fork and open a pull request.
Original file line number Diff line number Diff line change @@ -5,7 +5,10 @@ GOFILES_NOVENDOR = $(shell go list ./... | grep -v /vendor/)
5
5
all : vet fmt docs test
6
6
7
7
docs :
8
- ./scripts/fixup.sh
8
+ ./scripts/docs.sh generate
9
+
10
+ checkdocs :
11
+ ./scripts/docs.sh check
9
12
10
13
fmt :
11
14
go fmt $(GOFILES_NOVENDOR )
Original file line number Diff line number Diff line change @@ -11,8 +11,7 @@ function generate_markdown {
11
11
echo " Generating Github markdown"
12
12
oldpwd=$( pwd)
13
13
for i in $( find . -iname ' doc.go' -not -path " *vendor/*" ) ; do
14
- dir=${i%/* }
15
- realdir=$( realpath $dir )
14
+ realdir=$( cd $( dirname ${i} ) && pwd -P)
16
15
package=${realdir## ${GOPATH} / src/ }
17
16
echo " $package "
18
17
cd ${dir}
@@ -22,6 +21,22 @@ function generate_markdown {
22
21
done ;
23
22
}
24
23
25
- go get github.com/devnev/godoc2ghmd
26
- generate_markdown
27
- echo " returning $? "
24
+ function generate {
25
+ go get github.com/devnev/godoc2ghmd
26
+ generate_markdown
27
+ echo " returning $? "
28
+ }
29
+
30
+ function check {
31
+ generate
32
+ count=$( git diff --numstat | wc -l | sed -e ' s/^[[:space:]]*//' -e ' s/[[:space:]]*$//' )
33
+ echo $count
34
+ if [ " $count " = " 0" ]; then
35
+ return 0
36
+ else
37
+ echo " Your markdown docs seem to be out of sync with the package docs. Please run make and consult CONTRIBUTING.MD"
38
+ return 1
39
+ fi
40
+ }
41
+
42
+ " $@ "
Original file line number Diff line number Diff line change @@ -115,4 +115,4 @@ func WithTracer(tracer opentracing.Tracer) Option
115
115
WithTracer sets a custom tracer to be used for this middleware, otherwise the opentracing.GlobalTracer is used.
116
116
117
117
- - -
118
- Generated by [godoc2ghmd](https:// github.com/GandalfUK/godoc2ghmd)
118
+ Generated by [godoc2ghmd](https:// github.com/GandalfUK/godoc2ghmd)
You can’t perform that action at this time.
0 commit comments