Skip to content

Comments

docs: infer and codify development conventions from codebase#40

Closed
Copilot wants to merge 1 commit intorewrite-v2from
copilot/sub-pr-39
Closed

docs: infer and codify development conventions from codebase#40
Copilot wants to merge 1 commit intorewrite-v2from
copilot/sub-pr-39

Conversation

Copy link

Copilot AI commented Feb 22, 2026

@MattiaFailla requested a structured, enforceable rule set inferred from the current branch to guide automated code generation and human contributors alike.

Conventions documented (as a PR comment)

  • Code style & formattingruff ≥ 0.8, Python 3.14+, T | None union syntax, double quotes, mandatory module docstrings, standard import grouping
  • Naming patternsUPPER_CASE string constants, create_<feature>_handlers factories, _handle_<action> private handlers, PascalCase classes, _-prefixed private helpers
  • Architecture — three-layer design (handlersservicesdb), AsyncRepository abstract base with InMemory/Postgres implementations, closure-based handler injection, all user-facing strings centralized in strings.py, services wired through bot_data (no global singletons)
  • Testingpytest ≥ 8.0, InMemoryRepository for all unit tests (no live DB), per-test instance isolation, @pytest.mark.asyncio for coroutines
  • Anti-patterns — no hardcoded strings in handlers, no business logic in handlers, no direct SQL outside repository methods, no Optional[T]/Union[A, B] old-style syntax, no module-level mutable state, no bare except: outside Telegram API call sites

No source files were modified; the rule set was delivered as a reply to the review comment.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Rewrite entire Telegram bot codebase from scratch docs: infer and codify development conventions from codebase Feb 22, 2026
Copilot AI requested a review from MattiaFailla February 22, 2026 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants