Skip to content

Commit

Permalink
Update dev env instructions in contributor guide
Browse files Browse the repository at this point in the history
  • Loading branch information
akaihola committed Mar 9, 2024
1 parent d4af0fd commit 1e2ca28
Showing 1 changed file with 23 additions and 13 deletions.
36 changes: 23 additions & 13 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -89,22 +89,32 @@ GitHub Docs.
Setting up a development environment
====================================

To set up an isolated virtualenv for Darker development, run the test suite and lint
the code base on a Unix-like system::
To set up an isolated virtualenv for Darker development, modify code in your own branch,
run the test suite and lint modified code on a Unix-like system::

git clone [email protected]:akaihola/darker.git
python -m venv .venv-darker
source .venv-darker/bin/activate
cd darker
pip install -e '.[test]' mypy pylint flake8
pip install -e '.[test]'
git checkout -b my-feature-branch
# modify code
git commit -m "My feature"
pytest
pylint src
mypy .
flake8 src

Before pushing your commits to a feature branch, it's good to run::

darker --isort -L mypy -L pylint -L flake8 -r master... .

This will fix formatting on modified lines and list any linting errors your changes may
have introduced compared to the branching point of your feature branch from ``master``.
darker

Darker will fix formatting on modified lines and list any linting errors your changes
may have introduced compared to the branching point of your feature branch from
``master``.

Darker is configured in ``pyproject.toml`` to do the following on modified lines:
- reformat using Black
- sort imports using isort
- run Flake8
- run Mypy
- run Pydocstyle
- run Pylint
- run Ruff

Those tools have also been configured to match the conventions in the Darker code
base.

0 comments on commit 1e2ca28

Please sign in to comment.