diff --git a/docs/contribution.md b/docs/contribution.md index 6815944e2..c8cf36092 100644 --- a/docs/contribution.md +++ b/docs/contribution.md @@ -13,13 +13,16 @@ We welcome contributions! If you have an idea for a new module, or are a Python ```bash # clone your forked repo and cd into it -git clone git@github.com//bbot.git && cd bbot +git clone git@github.com//bbot.git +cd bbot # install poetry curl -sSL https://install.python-poetry.org | python3 - # install pip dependencies poetry install +# install pre-commit hooks, etc. +poetry postinstall # enter virtual environment poetry shell @@ -28,12 +31,7 @@ bbot --help ``` - Now, any changes you make in the code will be reflected in the `bbot` command. -- Run the tests locally to ensure they pass. -- Finally, commit and push your changes, and create a pull request to the `dev` branch of the main BBOT repo. - -## Running Tests - -BBOT makes use of pytest for its unit testing. You can run the tests simply by executing the bash script at `bbot/test/run_tests.sh`: +- After making your changes, run the tests locally to ensure they pass. ```bash # auto-format code indentation, etc. @@ -43,6 +41,9 @@ black . ./bbot/test/run_tests.sh ``` +- Finally, commit and push your changes, and create a pull request to the `dev` branch of the main BBOT repo. + + ## Creating a Module Writing a module is easy and requires only a basic understanding of Python. It consists of a few steps: diff --git a/pyproject.toml b/pyproject.toml index 56d7cac48..d5d60fbe9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,6 +23,7 @@ classifiers = [ [tool.poetry.scripts] bbot = 'bbot.cli:main' +postinstall = "pre-commit install" [tool.poetry.dependencies] python = "^3.9" @@ -73,7 +74,6 @@ env = [ [build-system] requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning"] build-backend = "poetry_dynamic_versioning.backend" -script = "pre-commit install" [tool.black] line-length = 119