Skip to content

Commit

Permalink
Add dev dependencies and instructions
Browse files Browse the repository at this point in the history
Added a "dev" group of optional dependencies to install pre-commit,
pylint, and pyright. (Black and isort are run from pre-commit, so they
are not included.)

Added some basic documentation for how to set up the development
environment.
  • Loading branch information
joelspadin committed Aug 25, 2024
1 parent 3d2c998 commit c999420
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,3 +239,23 @@ For example, to point ZMK CLI to an existing repo at `~/Documents/zmk-config`, r
```sh
zmk config user.home ~/Documents/zmk-config
```

# Development

If you would like to help improve ZMK CLI, you can clone this repo and install it in editable mode so your changes to the code apply when you run `zmk`. Open a terminal to the root directory of the repository and run:

```sh
pip install -e ".[dev]"
pre-commit install
```

You may optionally run these commands inside a [virtual environment](https://docs.python.org/3/library/venv.html) if you don't want to install ZMK CLI's dependencies globally or if your OS disallows doing this.

After running `pre-commit install`, your code will be checked when you make a commit, but there are some slower checks that do not run automatically. To run these additional checks, run these commands:

```sh
pyright .
pylint zmk
```

Alternatively, you can just create a pull request and GitHub will run the checks and report any errors.
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ dependencies = [
]
dynamic = ["version"]

[project.optional-dependencies]
dev = ["pre-commit", "pylint", "pyright"]

[project.urls]
Documentation = "https://zmk.dev/docs"
"Source Code" = "https://github.com/zmkfirmware/zmk-cli/"
Expand Down

0 comments on commit c999420

Please sign in to comment.