From f4674f1ca6e3a59028d559b30eafe07f74b59259 Mon Sep 17 00:00:00 2001 From: malteos Date: Mon, 22 Sep 2025 15:12:04 +0200 Subject: [PATCH] feat: Adding contributing.md --- CONTRIBUTING.md | 35 +++++++++++++++++++++++++++++++++++ README.md | 5 +++++ 2 files changed, 40 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..79ebdfa --- /dev/null +++ b/CONTRIBUTING.md @@ -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//.jsonl +pytest tests/test_cli.py::test_basics +``` + +## Code format & linting + +Please following the definitions from `.editorconfig` and `.flake8`. \ No newline at end of file diff --git a/README.md b/README.md index f22aec7..9d794ff 100644 --- a/README.md +++ b/README.md @@ -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