Skip to content
Open
Show file tree
Hide file tree
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
35 changes: 35 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Contributing to cdx_toolkit

We welcome contributions to cdx_toolkit! Whether you're adding new features, improving documentation, or fixing bugs, your help is greatly appreciated.

## Tests

To test code changes, please run our test suite before submitting pull requests:

```bash
# all tests (same as CI)
make test

# simple unit tests without integration tests
make unit
```

By default, all remote requests are mocked. To change this behaviour and actually call remote APIs (if you run this from a whitelisted IP address), the following environment variable can be set:

```bash
export DISABLE_MOCK_RESPONSES=1
```

If the remote APIs change, new mock data can be semi-automatically collected by setting another environment variable, running corresponding unit tests, and overwriting existing mock data in `tests/data/mock_responses`:

```bash
# set environment variable (DISABLE_MOCK_RESPONSES should not be set)
export SAVE_MOCK_RESPONSES=./tmp/mock_responses

# run the test for what mock data should be saved to $SAVE_MOCK_RESPONSES/<test_file>/<test_func>.jsonl
pytest tests/test_cli.py::test_basics
```

## Code format & linting

Please following the definitions from `.editorconfig` and `.flake8`.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,11 @@ instead of a partial one.

cdx_toolkit has reached the beta-testing stage of development.

## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines on contributing
and running tests.

## License

Copyright 2018-2020 Greg Lindahl and others
Expand Down