Skip to content

Commit

Permalink
The section about contributing to the project added to documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeykiselev committed Aug 20, 2019
1 parent f05d339 commit edb2081
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit edb2081

Please sign in to comment.