Skip to content

Commit cee8df0

Browse files
authored
Merge pull request #237 from ReactiveX/develop
v2
2 parents 9741d51 + 037b748 commit cee8df0

File tree

142 files changed

+11443
-3845
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

142 files changed

+11443
-3845
lines changed

.travis.yml

+11-8
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,27 @@
11
language: go
22

33
go:
4-
- 1.9
5-
- '1.10'
6-
- '1.11'
74
- master
85

96
matrix:
10-
allow_failures:
11-
- go: master
127
fast_finish: true
138

149
go_import_path: github.com/reactivex/rxgo
1510

1611
install:
12+
- go mod tidy
1713
- go get github.com/mattn/goveralls
18-
- go get github.com/stretchr/testify/assert
19-
- go get github.com/gorilla/websocket
14+
- go get -u github.com/kisielk/errcheck
15+
- curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $(go env GOPATH)/bin v1.21.0
16+
- go get -u golang.org/x/lint/golint
2017

21-
script: goveralls -service travis-ci -repotoken $COVERALLS_TOKEN
18+
script:
19+
- go test -v -race -cover -coverprofile=/tmp/coverage.out
20+
- errcheck ./...
21+
- go vet ./...
22+
- golangci-lint run
23+
- golint ./...
24+
- goveralls -coverprofile /tmp/coverage.out -service travis-ci -repotoken $COVERALLS_TOKEN
2225

2326
notifications:
2427
webhooks:

CONTRIBUTING.md

+26-22
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,39 @@
11
# Contributions Guidelines
2-
Contributions are always welcome. In fact, yours can shape the project this young. However, to make this a smooth collaboration experience for everyone and to maintain the quality of the code, here is a few things to consider before and after making a pull request:
32

4-
## Is it a feature or a patch?
5-
Before contributing, ask yourself if the change you're working on is a feature or a patch. A feature (like a new operator, function, etc.) needs a unit test with it, while a patch (like fixing a typo in `README.md`) may not. For small typos, it is always a good idea to just [email me](sendto:jo.chasinga@gmailcom) about it so we don't clutter the branch with super small changes.
3+
Contributions are always welcome. However, to make this a smooth collaboration experience for everyone and to maintain the quality of the code, here is a few things to consider before and after making a pull request:
64

7-
## Include a unit test
8-
Any change in the code other than small patches won't be accepted without a unit test. We use [testify/assert](https://github.com/stretchr/testify#assert-package) for the test.
5+
## Consistency
96

10-
## Read these great tips
7+
There are already +80 operators and +250 unit tests. Please don't try necessarily to reinvent the wheel and make sure to check first how the current implementation solves the most common problems.
118

12-
https://github.com/erlang/otp/wiki/Writing-good-commit-messages
13-
https://help.github.com/articles/closing-issues-via-commit-messages
14-
https://github.com/blog/1506-closing-issues-via-pull-requests
9+
## Edge Case
1510

16-
There is no rigid rule or anything, just remember that a brief, succinct commit summary line can go a long way. In general, please don't include issue number the commit intends to resolve (see the above link for tip on how to do that), alphanumeric or any symbols, or past tense. The commit summary line should reads like a short directive like:
11+
When we develop a new operator, there are a lot of edge cases to handle (eager/lazy observation, sequential vs parallel, on error strategy, etc.). The utility functions `observable()`, `single()` and `optionalSingle()` are there to help. Yet, it is not always possible to use them (observation of multiple Observables, etc.). In this case, you may want to take a look at existing operators like `WindowWithTime` to see an exhaustive implementation.
1712

18-
> Add feature A to class B
13+
## Unit Tests
1914

20-
If you would like to be more elaborate, please see the first link on how to add that to the commit description.
15+
Make sure to include unit tests. Again, consistency is key. In most of the unit tests, we use the RxGo assertion API.
2116

22-
## Open an issue
23-
This is to encourage discussions and reach a sound design decision before implementing an additional feature or fixing a bug. If you're proposing a new feature, make it obvious in the subject.
24-
25-
## Create a feature branch
26-
Always create a branch dedicated to the feature or fix you intend to be merged into the base repository and keep it clean and commits minimal.
17+
## Duration
2718

28-
## Squash your commits
29-
It is asked that you [squash your commits](https://github.com/blog/2141-squash-your-commits) down to a few, or one, discreet change sets before submitting a pull request. Fixing a bug will usually only need one commit, while a larger feature might contain a couple of separate improvements that is easier to track through different commits.
19+
If an operator input contains a duration, we should use `rxgo.Duration`. It allows us to mock it and to implement deterministic tests whenever possible using `timeCausality()`.
3020

31-
## Include some comments
32-
It is not mandatory but rather nice to have a short comment accompanying a pull request. We're all humans here and sometime we lose tracks of things.
21+
## Write Nice Code
3322

34-
## Write nice code
3523
Try to write idiomatic code according to [Go style guide](https://github.com/golang/go/wiki/CodeReviewComments). Also, see this project style guide for project-specific idioms (when in doubt, consult the first).
24+
25+
## Code Formatting
26+
27+
Before to create a pull request, make sure to format your code using:
28+
29+
* [gofumpt](https://github.com/mvdan/gofumpt):
30+
* Install: `go get mvdan.cc/gofumpt`
31+
* Execute: `gofumpt -s -w .`
32+
33+
* [goimports](https://godoc.org/golang.org/x/tools/cmd/goimports):
34+
* Install: `go get golang.o`
35+
* Execute: `goimports -w .`
36+
37+
## Open an issue
38+
39+
This is to encourage discussions and reach a sound design decision before implementing an additional feature or fixing a bug. If you're proposing a new feature, make it obvious in the subject.

LICENSE LICENSE.md

File renamed without changes.

0 commit comments

Comments
 (0)