From edb2081b3f3b56f27e9d21f25d41990a5c111b00 Mon Sep 17 00:00:00 2001 From: Alexey Kiselev Date: Tue, 20 Aug 2019 12:32:39 +0300 Subject: [PATCH] The section about contributing to the project added to documentation. --- README.md | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/README.md b/README.md index f5bf857..772384f 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,61 @@ the [General Decimal Arithmetic](http://speleotrove.com/decimal/) specification. `decimal` only explicitly supports the two most recent major Go 1.X versions. +## Contributing to `decimal` + +We welcome contributions to `decimal` of any kinds including bug reports, issues, feature requests, PRs to documentation, feature implementations and bug fixes. + +### Code contribution + +To make a contribution do the following: + +* Fork the project, start new branch and make your changes +* Make test cases for the new code +* Do not forget to run `go fmt` +* Add or update documentation if you are adding new features or changing functionality +* Provide a good commit message with the reference to a closed issue if any + +### Testing the code + +There are 4 main types of tests: + +1. Python-generated test tables. Python 3 is used to generate test tables that are parsed using the `suite` package. +2. `dectest` tables. The `dectest` tables are similar to Python tables. They are parsed using `dectest` package. +3. Custom tests. The custom tests are strewn thought the different *_test.go files. +4. Bug-specific tests. They are placed inside `issues_test.go` file. + +#### Generating test data + +Before running the tests test data have to be generated. + +To generate Python test tables run the following commands inside the project's directory: + +``` +cd testdata/pytables +./tables.py 500 +cd ../.. +``` + +To generate `dectest` data execute the command: + +``` +testdata/dectest/generate.bash +``` + +#### Running the test cases + +To run the full test suite execute the following command. Please, note that the timeout for tests increased to 30 minutes. + +``` +go test -timeout 30m -v +``` + +Some test could take a long time, use `-short` flag to run only quick tests. + +``` +go test -short -v +``` + ## License [BSD 3-clause](https://github.com/ericlagergren/decimal/blob/master/LICENSE)