All code in this project follows Python standard conventions — PEP 8 for style, PEP 257 for docstrings, and every new function must be covered by pytest tests before the PR can be approved. Reviewers check these standards explicitly and will request changes for any code that does not meet them.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/WorkTeam01/team-practice/llms.txt
Use this file to discover all available pages before exploring further.
Python style (PEP 8)
The project follows PEP 8 — the official Python style guide. The most important rules to keep in mind while contributing are:- 4-space indentation — never tabs.
- Maximum line length of 79 characters — break long expressions across multiple lines using parentheses.
snake_casefor functions and variables — e.g.abs_value,first_number,current_value.- Meaningful names —
dividendanddivisorare better thanaandbwhen the role is clear; single-letter names are acceptable only in mathematical contexts (e.g.add(a, b)).
Docstrings (PEP 257)
Every public function must have a docstring. The project uses the Google-style docstring format withArgs, Returns, Raises, and Examples sections. Below is the exact format used in calculator.py:
Examples section with at least two cases — one typical and one edge case (negative number, zero, boundary value). If the function can raise an exception, add a Raises section as well.
Type annotations
All function signatures use Python type hints. Annotate every parameter and the return value. Use built-in types (float, str, bool) rather than importing from typing for simple signatures.
Testing requirements
The project ships with 63+ test cases across two test modules. Every contribution must maintain or extend that coverage.- Every new function added to
src/calculator.pyneeds corresponding tests intests/test_calculator.py. - Every new GUI behaviour added to
src/gui.pyneeds corresponding tests intests/test_gui.py. - GUI tests must use the tkinter mocks provided in
tests/conftest.pyso that they run in headless CI environments without a display.
Code review checklist
What reviewers check
What reviewers check
CI status
Does the PR pass all CI tests in the GitHub Actions pipeline? A failing pipeline blocks merge regardless of approval.
Docstrings
Are all new public functions documented with a proper PEP 257 docstring including
Test coverage
Do new features or bug fixes have corresponding tests? Edge cases (zero, negatives, invalid input) should be explicitly covered.
PEP 8 compliance
Does the code follow PEP 8 style? Check indentation, line length, naming conventions, and blank-line usage.
Conventional Commits
Is every commit message in the
Correct PR target
Does the PR target
Does the PR pass all CI tests in the GitHub Actions pipeline? A failing pipeline blocks merge regardless of approval.
Docstrings
Are all new public functions documented with a proper PEP 257 docstring including
Args, Returns, and Examples sections?Test coverage
Do new features or bug fixes have corresponding tests? Edge cases (zero, negatives, invalid input) should be explicitly covered.
PEP 8 compliance
Does the code follow PEP 8 style? Check indentation, line length, naming conventions, and blank-line usage.
Conventional Commits
Is every commit message in the
<type>: <short description> format? See the Commit Conventions page.Correct PR target
Does the PR target
dev and not main? PRs targeting main will be redirected.