During my many years working as a developer, my main programming language has been Python. I've learned many cool features during this time, and a few lessons were learned. Additionally, I have incorporated good practices into my code.
This repository is created to group some of these lessons into different levels (beginner, intermediate and advanced). Tests are included, so it is easy to understand and practice with them.
All lessons is available online on the last version.
TL;DR: make install
to install dependencies, make server
to start mkdocs
server to access documentation.
Makefile is your friend. All commands are available through it, so it is quite
easy and friendly usage. Run make
or make help
to get more information for
the commands to use.
Architecture Decision Records (ADR) are used to document the architectural
decisions taken on the project. They are located in the docs/adr
folder.
- ADR-001: poetry
- ADR-002: mkdocs
- ADR-003: cSpell
- ADR-004: Deployment
The code is written in Python, and the documentation is written in Markdown. The structure of the code is simple:
- All the markdown files are located in the
docs
folder. - The code is located in the
src
folder. - Test are located in the
tests
folder.
Other folders and files are used to configure the project or help to maintain and develop it.
- The project is configured to use GitHub Actions to automatically deploy the
documentation to GitHub Pages
once code is merged into
master
. The workflow is defined in.github/workflows/ci-deployment.yml
.
The project is configured to use pre-commit to check
Python and markdown files are following the style guide. pre-commit is
automatically installed when running make install
.
Rules are defined in .pre-commit-config.yaml
and include:
- markdownlint: markdown code linter.
- black: Python code formatter.
- bandit: Python security linter.
- ruff: Python code linter.
- cspell: Spelling checker.
- mkdocs-build: Local hook to make sure mkdocs build is working properly.
If you want to trigger manually the execution, run pre-commit run --all-files
to execute all pre-commits checks for all files in the project, or
pre-commit run -a <hook_id>
to run a specific hook.
The project has been developed using Visual Studio Code.
It is not mandatory to use VSCode, but it is recommended. The project includes a settings file to help to maintain similar settings used during the development.