-
Notifications
You must be signed in to change notification settings - Fork 561
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #743 from blacklanternsecurity/pre-commit
Use Pre-commit
- Loading branch information
Showing
3 changed files
with
136 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 [email protected]/<username>/bbot.git && cd bbot | ||
git clone [email protected]/<username>/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 run pre-commit install | ||
|
||
# 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: | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters