Thank you for considering contributing to the Telegram File Statistics Bot! We welcome contributions from the community and are excited to see what you can bring to the project.
Please read our Code of Conduct to understand the standards we expect from our community.
If you find a bug, please create an issue using the bug report template. Provide as much detail as possible to help us understand and reproduce the issue.
If you have an idea for a new feature, please create an issue using the feature request template. Describe your idea in detail and explain why it would be beneficial to the project.
- Fork the repository.
- Create a new branch for your feature or bugfix:
git checkout -b my-feature-branch
- Make your changes.
- Ensure that your code follows the project's style and guidelines.
- Write tests for your changes, if applicable.
- Commit your changes, following the conventional commits format:
git commit -m "<type>: description of my changes"
- Push your branch to your fork:
git push origin my-feature-branch
- Create a pull request using the pull request template.
To set up the development environment, follow these steps:
-
Clone the repository:
git clone https://github.com/Francesco146/telegram-file-statistics-bot.git cd telegram-file-statistics-bot
-
Install
uv
if you haven't already:pip install uv
-
Create a new virtual environment using
uv
:uv venv
and activate it:
source .venv/bin/activate
-
Install the required packages using
uv
:uv sync --all-extras --dev
To run the tests, use the following command:
uv run pytest
Wanted passing tests are 100%
.
To run the linting tools, use the following command:
uv run pylint $(find src tests -name "*.py" -type f)
Wanted score is 10.00/10
.
We use xgettext
, msgmerge
, and msgfmt
for handling translations. Here is how you can contribute to translations:
-
Run all steps (extract translatable strings, update the POT file, update the
.po
files, and compile the.po
files to.mo
files):make all
-
Verify that the translations are working correctly by running the bot and checking the translated messages. If you find any issues, use the built-in help command:
make help
If you want to add a new language, you can add a new
.po
file in thelocales/<lang>
directory and run themake all
command. It will generate the needed headers.
This project utilizes GitHub Actions for automating continuous integration and deployment:
- Build Pull Request: Executes automated checks and builds when a pull request is made to the
dev
branch. - Release: Handles deployments whenever changes are pushed to
master
ordev
, or manually triggered. - Pytest: Runs unit tests with each code push, generating a badge to reflect test results.
- Pylint: Performs code linting on every code push, creating a badge to indicate the status.
- Create Pull Request: Automatically generates a pull request from
dev
tomaster
whenever new changes are pushed todev
, or triggered manually.