Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The section about contributing to the project added to documentation. #137

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)