Skip to content

Commit 7edb9fd

Browse files
authored
Merge pull request #8 from NikitosKey/ref-text-locale
Refactoring complete
2 parents 8712a62 + d0afb24 commit 7edb9fd

39 files changed

+1723
-628
lines changed

Diff for: .github/workflows/python-poetry-code-quality.yml

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: code-quality
2+
3+
on:
4+
push:
5+
6+
jobs:
7+
pylint:
8+
runs-on: ubuntu-latest
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
python-version: ["3.13"]
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Set up Python ${{ matrix.python-version }}
18+
uses: actions/setup-python@v3
19+
with:
20+
python-version: ${{ matrix.python-version }}
21+
22+
- name: install poetry
23+
run: pipx install poetry
24+
25+
- name: Check pyproject.toml validity
26+
run: poetry check --no-interaction
27+
28+
- name: Install deps
29+
if: steps.cache-deps.cache-hit != 'true'
30+
run: |
31+
poetry config virtualenvs.in-project true
32+
poetry install --no-interaction
33+
34+
- name: Analysing the code with pylint
35+
run: poetry run pylint bot
36+
37+
test:
38+
runs-on: ubuntu-latest
39+
strategy:
40+
fail-fast: false
41+
matrix:
42+
python-version: [ "3.13" ]
43+
44+
steps:
45+
- uses: actions/checkout@v4
46+
47+
- name: Set up Python ${{ matrix.python-version }}
48+
uses: actions/setup-python@v3
49+
with:
50+
python-version: ${{ matrix.python-version }}
51+
52+
- name: Install poetry
53+
run: pipx install poetry
54+
55+
- name: Check pyproject.toml validity
56+
run: poetry check --no-interaction
57+
58+
- name: Install deps
59+
if: steps.cache-deps.cache-hit != 'true'
60+
run: |
61+
poetry config virtualenvs.in-project true
62+
poetry install --no-interaction
63+
64+
- name: Test with pytest
65+
run: |
66+
poetry run pytest -v --cov=bot

Diff for: README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
2-
[![Actions](https://github.com/NikitosKey/alcounting_bot/actions/workflows/main.yml/badge.svg)](https://github.com/NikitosKey/alcounting_bot/actions/workflows/main.yml)
1+
[![code-quality](https://github.com/NikitosKey/alcounting_bot/actions/workflows/python-poetry-code-quality.yml/badge.svg)](https://github.com/NikitosKey/alcounting_bot/actions/workflows/python-poetry-code-quality.yml)
32

43
# Alcounting Telegram Bot
54

@@ -9,7 +8,8 @@ A bot designed to help manage parties and prevent organizers from going into the
98

109
- [Description](#description)
1110
- [Guide](#Guide)
12-
- [User Documentation](#user-documentation)
11+
- [Documentation](#documentation)
12+
- [Contributing](#contributing)
1313

1414
## Description
1515

Diff for: bot/__init__.py

Whitespace-only changes.

Diff for: bot/__main__.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1+
"""
2+
This module initializes and runs the bot application.
3+
"""
4+
15
import os
26
import logging
37
from telegram import Update
48
from telegram.ext import Application
59

6-
from handlers import register_handlers
10+
from bot.handlers import register_handlers
711

812
# Set up logging
913
logging.basicConfig(
@@ -18,12 +22,12 @@
1822
def main() -> None:
1923
"""Allow running a bot."""
2024
# Create the Application and pass it your bot's token.
21-
application = Application.builder().token(os.getenv('BOT_TOKEN')).build()
25+
application = Application.builder().token(os.getenv("BOT_TOKEN")).build()
2226

2327
# Register all handlers
2428
register_handlers(application)
2529

26-
# Run the bot until the user presses Ctrl-C
30+
# Run the bot
2731
application.run_polling(allowed_updates=Update.ALL_TYPES)
2832

2933

Diff for: bot/database/__init__.py

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1+
"""Module for database operations."""
2+
13
from bot.database.database import Database
24
from bot.database.user import User
35
from bot.database.product import Product
46
from bot.database.order import Order
57

6-
__all__ = [
7-
'Database',
8-
'User',
9-
'Product',
10-
'Order'
11-
]
8+
__all__ = ["Database", "User", "Product", "Order"]

0 commit comments

Comments
 (0)