Contributing
We love contributions! We've compiled this documentation to help you understand our
contributing guidelines. Please also read our CODE_OF_CONDUCT.md.
Getting started
To start contributing, open your terminal and install the package and pre-commit hooks using:
The pre-commit hooks are a security feature to ensure, for example, no secrets, large data files, or Jupyter notebook outputs are accidentally committed into the repository. For more information and common use cases, please refer to a hook's documentation such as detect-secrets or nbstripout.
Code conventions
We mainly follow the GDS Way in our code conventions. For Python code, we follow the GDS Way Python style guide, and use the flake8 pre-commit hook for linting.
Git and GitHub
We use Git to version control the source code. Please read the Quality assurance of code for analysis and research for details on Git best practice. This includes how to write good commit messages, how to branch appropriately and solve merge conflicts.
The .gitignore used in this repository was created with generic exclusions from gitignore.io.
Pull requests into main require at least one approved review.
Markdown
Local links can be written as normal, but external links should be referenced at the bottom of the Markdown file for clarity. For example:
Use a local link to reference the using_pytest.md file, but an external
link for GOV.UK.
We also try to wrap Markdown to a line length of 88 characters, but this is not strictly enforced in all cases, for example with long hyperlinks.
Testing
Tests are written using the pytest framework, with its configuration in the
pyproject.toml file. Note, only tests in the tests folder are run. To run the
tests, enter the following command in your terminal:
Code coverage
Code coverage of Python scripts is measured using the coverage Python
package; its configuration can be found in pyproject.toml. Note coverage
only extends to Python scripts in the datachecker folder.
To run code coverage, and view it as an HTML report, enter the following command in your terminal:
The HTML report can be accessed at htmlcov/index.html.
Documentation
Documentation is stored in the docs folder unless it's more
appropriate to store it elsewhere, like this contributing guidance. We
write our documentation in MyST Markdown.