Extra information to contributors (#1491)
Motivation: The more contributors know what's expected of them upfront the less likely they are to consume reviewer time and experience a harsh review. Modifications: Add some extra commentary to CONTRIBUTORS.md Add a docker compose example with specific ubuntu/swift versions to README.md Result: Contributors will be more informed. Co-authored-by: Cory Benfield <lukasa@apple.com>
This commit is contained in:
parent
0695662d7d
commit
5779ddd54b
|
@ -63,11 +63,31 @@ We require that your commit messages match our template. The easiest way to do t
|
|||
|
||||
git config commit.template dev/git.commit.template
|
||||
|
||||
The default policy for taking contributions is “Squash and Merge” - because of this the commit message format rule above applies to the PR rather than every commit contained within it.
|
||||
|
||||
### Make sure Tests work on Linux
|
||||
|
||||
SwiftNIO uses XCTest to run tests on both macOS and Linux. While the macOS version of XCTest is able to use the Objective-C runtime to discover tests at execution time, the Linux version is not.
|
||||
SwiftNIO uses XCTest to run tests on both macOS and Linux. While the macOS version of XCTest is able to use the Objective-C runtime to discover tests at execution time, the Linux version is not (prior to swift 5.1).
|
||||
For this reason, whenever you add new tests **you have to run a script** that generates the hooks needed to run those tests on Linux, or our CI will complain that the tests are not all present on Linux. To do this, merely execute `ruby ./scripts/generate_linux_tests.rb` at the root of the package and check the changes it made.
|
||||
|
||||
### Make sure your patch works for all supported versions of swift
|
||||
|
||||
The CI will do this for you. You can use the docker-compose files included if you wish to check locally. Currently all versions of swift >= 5.0 are supported. For example usage of docker compose see the main [README](./README.md#an-alternative-using-docker-compose)
|
||||
|
||||
### Make sure your code is performant
|
||||
|
||||
SwiftNIO has been created to be high performance. The integration tests cover some measures of performance including allocations which should be avoided if possible. For help with allocation problems refer to the guide to [allocation debugging](./docs/debugging-allocations.md)
|
||||
|
||||
### Formatting
|
||||
|
||||
Try to keep your lines less than 120 characters long so github can correctly display your changes.
|
||||
|
||||
It is intended SwiftNIO will use the swift-format tool in the future to bring consistency to code formatting. To follow the discussion on this topic see the swift evolution proposal [SE-250](https://github.com/apple/swift-evolution/blob/master/proposals/0250-swift-style-guide-and-formatter.md)
|
||||
|
||||
### Extensibility
|
||||
|
||||
Try to make sure your code is robust to future extensions. The public interface is very hard to change after release - please refer to the [API guidelines](./docs/public-api.md)
|
||||
|
||||
## How to contribute your work
|
||||
|
||||
Please open a pull request at https://github.com/apple/swift-nio. Make sure the CI passes, and then wait for code review.
|
||||
|
|
|
@ -286,6 +286,10 @@ First make sure you have [Docker](https://www.docker.com/community-edition) inst
|
|||
Will create a base image, compile SwiftNIO, and run a sample `NIOHTTP1Server` on
|
||||
`localhost:8888`. Test it by `curl http://localhost:8888`
|
||||
|
||||
- `docker-compose -f docker/docker-compose.yaml -f docker/docker-compose.1604.53.yaml run test`
|
||||
|
||||
Will create a base image using ubuntu 16.04 and swift 5.3, compile SwiftNIO and run the unit and integration tests. Files exist for other ubuntu and swift versions in the docker directory.
|
||||
|
||||
|
||||
## Developing SwiftNIO
|
||||
|
||||
|
|
Loading…
Reference in New Issue