Skip to content

Commit

Permalink
📝 update contributor guide
Browse files Browse the repository at this point in the history
  • Loading branch information
haliphax committed Oct 12, 2023
1 parent 865a9f2 commit 449dd60
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 28 deletions.
9 changes: 4 additions & 5 deletions .devcontainer/on-create.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@ pyenv virtualenv 3.11 xthulu
echo xthulu > .python-version
cp .devcontainer/docker-compose.override.yml .
pip install -Ue .[dev,hiredis]
npm install
pre-commit install
npm ci
pre-commit install --install-hooks
etc/gitmoji-hook.sh
docker-compose build
docker-compose pull

docker compose build
docker compose pull
46 changes: 23 additions & 23 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# Contributor guide

⚠️ Contribution at this point is not recommended, but isn't necessarily
unwelcome. Please [open an issue] with the `enhancement` label with your
unwelcome. Please [open an issue][] with the `enhancement` label with your
proposed changes before beginning any work in earnest.

## Virtual environment

It is all but _required_ that you use a Python virtual environment for
development. These instructions will assume that you are using [pyenv], and have
already installed and configured it on your system.
development. These instructions will assume that you are using [pyenv][], and
have already installed and configured it on your system.

If you are using [Dev Containers], you may use the repository's configuration to
create a new development container. Its `onCreateCommand` script will handle all
of the steps detailed below.
If you are using [Dev Containers][], you may use the repository's configuration
to create a new development container. Its `onCreateCommand` script will handle
all of the steps detailed below.

### Create the environment

Expand All @@ -27,47 +27,47 @@ pyenv activate xthulu
In addition to the standard dependencies for the project, a set of
developer-focused dependencies are included. Some of them are located in the
`dev` optional dependencies bundle from the project's Python package, but others
come from the [node.js] ecosystem.
come from the [node.js][] ecosystem.

```shell
pip install -e .[dev]
pip install -e .[dev,hiredis]
nodeenv -p
npm install
npm ci
```

## Configure development tools

### pre-commit

This project makes use of the [pre-commit] system. The following applications
This project makes use of the [pre-commit][] system. The following applications
are used to lint source code and check formatting:

- [Black] - Python formatter
- [Prettier] - Miscellaneous formatter
- [Ruff] - Python linter
- [Black][] - Python formatter
- [Prettier][] - Miscellaneous formatter
- [Ruff][] - Python linter

You must initialize the system and install the appropriate hooks. Once
installed, they will be invoked automatically when you commit.

```shell
pre-commit install
pre-commit install --install-hooks
```

### gitmoji

For conventional commit messages, this project has adopted the [gitmoji]
For conventional commit messages, this project has adopted the [gitmoji][]
standard. The `prepare-commit-msg` hook for crafting appropriately-categorized
commit messages can be installed with the provided script.

```shell
etc/gitmoji-hook.sh
```

### docker-compose
### docker compose

In order to avoid the need to rebuild the service containers' base image each
time you make changes to the source code, you can create an override
configuration for the `docker-compose` stack. This configuration will mount the
configuration for the `docker compose` stack. This configuration will mount the
live source code directory into the running containers so that restarting them
should be sufficient to pick up any changes.

Expand Down Expand Up @@ -146,21 +146,21 @@ class TestExample(TestCase):

### Test coverage

The [coverage] application is used to calculate test coverage after unit tests
The [coverage][] application is used to calculate test coverage after unit tests
have been run.

```shell
coverage run --source=xthulu --omit="xthulu/__main__.py" -m unittest
coverage report
```

[open an issue]: https://github.com/haliphax/xthulu/issues/new?labels=enhancement&title=Proposal:%20
[pyenv]: https://github.com/pyenv/pyenv
[black]: https://black.readthedocs.io/en/stable/index.html
[coverage]: https://coverage.readthedocs.io/en/latest/
[dev containers]: https://containers.dev/
[gitmoji]: https://gitmoji.dev
[node.js]: https://nodejs.org
[open an issue]: https://github.com/haliphax/xthulu/issues/new?labels=enhancement&title=Proposal:%20
[pre-commit]: https://pre-commit.com/
[black]: https://black.readthedocs.io/en/stable/index.html
[prettier]: https://prettier.io/
[pyenv]: https://github.com/pyenv/pyenv
[ruff]: https://beta.ruff.rs/docs/
[gitmoji]: https://gitmoji.dev
[coverage]: https://coverage.readthedocs.io/en/latest/

0 comments on commit 449dd60

Please sign in to comment.