govcookiecutter
structure
This page provides information on the govcookiecutter
repository structure.
Further detail on folder contents is available:
Top-level files
Each subsection here contains a brief description about the files at the top-level of this Git repository.
.flake8
A configuration file for the flake8
Python package that provides linting. This file
is based on the common configuration described in the GDS Way.
.gitignore
A .gitignore
file to specify that git should not track certain files and folders in this repository.
.pre-commit-config.yaml
A pre-commit hook file covering linting, secret detection, and styling among other things.
.secrets.baseline
A file for configuration of the detect-secrets
detect-secrets pre-commit hook. detect-secrets
prevents secrets from being committed
to the repository. The baseline file flags secret-like data that the user deliberately wishes to commit the to repository.
CHANGELOG.md
A file describing the changes made to govcookiecutter
over time, including unreleased
and upcoming changes.
CODE_OF_CONDUCT.md
The Code of Conduct describes how contributors should interact
with each other on the project.
It also contains information about the responsibilities of contributors
both within and outside of the best-practice-and-impact
organisation.
conftest.py
A file to store shared fixture functions for the pytest
tests in the tests
folder.
CONTRIBUTING.md
The contributing guidelines for this project, explaining how contributors can
engage with govcookiecutter
.
LICENSE
The licence describes how the project can be used or re-used by others. Unless stated otherwise, the codebase is released under the MIT License. This covers both the codebase and any sample code in the documentation. The documentation is © Crown copyright and available under the terms of the Open Government 3.0 licence.
Makefile
The Makefile
contains a set of commands for the make
utility, more often
used on Unix-like and Linux systems. This allows a user to, for example,
run the help
command for further information at the top-level of the Git repository.
make help
pyproject.toml
A file containing Python project settings. This includes configuration settings for:
isort
Python imports are arranged according to the specification defined by black
.
pytest
To run the tests within the tests
, and {{ cookiecutter.repo_name }}/tests
folders
using the pytest
Python package, enter the following command:
pytest
Code coverage
To run code coverage using the coverage
Python package with pytest
, enter the
following command:
coverage run -m pytest
coverage html
Unix and Linux users can use the make
command:
make coverage_html
A code coverage report in HTML will be produced on the code in the hooks
and
{{ cookiecutter.repo_name }}/{{ cookiecutter.repo_name.lower().replace(' ', '_').replace('-', '_') }}
folders.
This HTML report can be accessed at htmlcov/index.html
.
README.md
An overview of the Git repository and aims of govcookiecutter
, including all necessary instructions to run the code.
requirements.txt
A list of Python package dependencies for the govcookiecutter
repository,
which can be installed using the pip install
command:
pip install --requirement requirements.txt
Alternatively, Unix and Linux users can install the requirements along with pre-commit hooks by running the following command:
make requirements