Skip to content

Commit

Permalink
Documentaion - Update RST files and README with constraint checks
Browse files Browse the repository at this point in the history
  • Loading branch information
paulosgf committed Sep 30, 2022
1 parent 6d0ad9b commit b3f5b4d
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 6 deletions.
24 changes: 23 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ if message received == .hi:
- don't forget to add your country flag here after accepted PR. i'll have to hunt it down on your profile if not.
- make sure to follow PEP8

**about PR**
**About PR**

first clone the project

Expand All @@ -298,12 +298,34 @@ cd into the project
cd honeybot
```

create a virtualenv to work with different python \ libs versions

```
python -m venv venv
source venv/bin/activate
```

install the tools needed to make the constraint checks

```
pip install black isort bandit pre-commit
pre-commit install
```

different changes to different files. for example, someone making a weather plugin first he creates a new branch

```
git checkout -b "weather-plugin"
```

test if all files are well formatted, complying with style and security rules, before send the PR

```
black --check --verbose --config ./pyproject.toml src/honeybot/plugins/downloaded/weather/main.py
isort --check-only --settings-path ./pyproject.toml src/honeybot/plugins/downloaded/weather/main.py
bandit -ll -c ./pyproject.toml -r src/honeybot/plugins/downloaded/weather/main.py
```

then he commits

```
Expand Down
23 changes: 23 additions & 0 deletions docs/source/How_Tos/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,35 @@ cd into the project
cd honeybot
create a virtualenv to work with different python \ libs versions

.. code-block::
python -m venv venv
source venv/bin/activate
install the tools needed to make the constraint checks

.. code-block::
pip install black isort bandit pre-commit
pre-commit install
different changes to different files. for example, someone making a weather plugin first he creates a new branch

.. code-block::
git checkout -b "weather-plugin"
test if all files are well formatted, complying with style and security rules, before send the PR

.. code-block::
black --check --verbose --config ./pyproject.toml src/honeybot/plugins/downloaded/weather/main.py
isort --check-only --settings-path ./pyproject.toml src/honeybot/plugins/downloaded/weather/main.py
bandit -ll -c ./pyproject.toml -r src/honeybot/plugins/downloaded/weather/main.py
then he commits

.. code-block::
Expand Down
10 changes: 5 additions & 5 deletions docs/source/How_Tos/documentation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ Your folder structure needs to look as follows:
Generating docs
^^^^^^^^^^^^^^^

Once you’re set up you can test if sphinx works properly in `honeybot/docs/`_ directory, by changing to 'html' folder, opening a terminal and typing **'sphinx-build ../docs/source/ .'**. This will take the *.rst files in `honeybot/docs/source*`_ and ‘make’ them into html in 'html/' folder that contains the **gh-pages** branch. If it shows any warning you’ll have to fix them before committing, otherwise the documentation wont be automatically build once you push your changes to Github.
Once you’re set up you can test if sphinx works properly in `honeybot/docs/`_ directory, by changing to 'html' folder, opening a terminal and typing **'sphinx-build ../docs/source/ .'**. This will take the *.rst* files in
`honeybot/docs/source/`_ and ‘make’ them into html in 'html/' folder that contains the 'gh-pages' branch. If it shows any warning you’ll have to fix them before committing, otherwise the documentation wont be automatically build once you push your changes to Github.
Next you can 'add' and 'commit' these changes into your fork by typing:

**git add \***
Expand All @@ -66,15 +67,15 @@ Finally, you can make a pull request by typing:

And this'll create a PR in the **gh-pages** branch that'll be analysed by someone in project.

Later do you still need to push the master branch too. Because the *.rst files are on this branch and were not go to the previus PR:
Later do you still need to push the master branch too. Because the *.rst* files are on this branch and were not go to the previus PR:

**git add docs/source/\***
**git add docs/source \***

**git commit -m "Commit message"**

**git push origin master**

Since I won't provide a full tutorial on how to write rst files here is a useful
Since I won't provide a full tutorial on how to write *.rst* files here is a useful
link:
rst_

Expand All @@ -86,4 +87,3 @@ rst_
.. _honeybot/docs/source/How_Tos/: https://github.com/pyhoneybot/honeybot/tree/master/docs/source/How_Tos
.. _honeybot/docs/source/Plugins/: https://github.com/pyhoneybot/honeybot/tree/master/docs/source/Plugins
.. _honeybot/docs/: https://github.com/pyhoneybot/honeybot/tree/master/docs
.. _honeybot/docs/source*: https://github.com/pyhoneybot/honeybot/tree/master/docs/source
1 change: 1 addition & 0 deletions html
Submodule html added at e34099

0 comments on commit b3f5b4d

Please sign in to comment.