Skip to content

Conversation

@nanotaboada
Copy link
Owner

@nanotaboada nanotaboada commented May 25, 2025

This change is Reviewable

Summary by CodeRabbit

  • New Features

    • Added automatic code formatting checks using Black in the development workflow.
    • Recommended the Black formatter extension for VS Code users.
  • Style

    • Standardized code formatting across the project to use Black with a line length of 88 characters.
    • Improved code readability with consistent spacing and formatting in multiple files.
    • Updated editor settings to use Black as the default formatter and set word wrap at 88 characters.
  • Documentation

    • Updated contributing guidelines with clearer instructions on code formatting, commit conventions, testing, and issue reporting.
    • Added a Black code style compliance badge to the README.
  • Tests

    • Renamed test functions and updated docstrings for clearer and more concise test descriptions.

@coderabbitai
Copy link

coderabbitai bot commented May 25, 2025

Walkthrough

This set of changes updates code style and formatting configurations to enforce a line length of 88, adopts Black as the code formatter, and aligns related tooling and documentation. It modifies linting and CI workflows, VSCode settings, and the contributing guide. Code files are reformatted for consistency, with no changes to logic or public APIs.

Changes

File(s) Change Summary
.flake8, pyproject.toml, requirements-lint.txt Updated linting and formatting configuration: set line length to 88, broadened flake8 checks, added Black config.
.github/workflows/python-app.yml Renamed dependency install steps; added Black formatting check to lint job.
.vscode/extensions.json, .vscode/settings.json Recommended Black formatter extension; set Black as default formatter; set ruler/word wrap to 88 chars.
CONTRIBUTING.md Expanded and clarified guidelines, specifying Black and flake8 usage, and updated workflow/testing instructions.
databases/player_database.py, main.py, models/player_model.py, routes/health_route.py, routes/player_route.py, services/player_service.py, tests/player_stub.py Reformatted code: added blank lines, adjusted whitespace, trailing commas, and consistent parameter formatting.
schemas/player_schema.py Changed SQLAlchemy column name string delimiters from single to double quotes.
tests/test_main.py Renamed test functions and docstrings for conciseness and consistency; unchanged test logic.

Possibly related PRs


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4426985 and cc61d5a.

📒 Files selected for processing (6)
  • .vscode/extensions.json (1 hunks)
  • .vscode/settings.json (1 hunks)
  • models/player_model.py (3 hunks)
  • routes/health_route.py (1 hunks)
  • routes/player_route.py (10 hunks)
  • services/player_service.py (7 hunks)
🚧 Files skipped from review as they are similar to previous changes (4)
  • .vscode/extensions.json
  • routes/health_route.py
  • models/player_model.py
  • services/player_service.py
🧰 Additional context used
🧬 Code Graph Analysis (1)
routes/player_route.py (3)
models/player_model.py (1)
  • PlayerModel (33-63)
databases/player_database.py (1)
  • generate_async_session (35-43)
services/player_service.py (4)
  • retrieve_by_squad_number_async (83-99)
  • retrieve_by_id_async (68-80)
  • update_async (105-135)
  • delete_async (141-160)
🪛 Ruff (0.11.9)
routes/player_route.py

45-45: Do not perform function call Body in argument defaults; instead, perform the call within the function, or read the default from a module-level singleton variable

(B008)


46-46: Do not perform function call Depends in argument defaults; instead, perform the call within the function, or read the default from a module-level singleton variable

(B008)


77-77: Do not perform function call Depends in argument defaults; instead, perform the call within the function, or read the default from a module-level singleton variable

(B008)


106-106: Do not perform function call Depends in argument defaults; instead, perform the call within the function, or read the default from a module-level singleton variable

(B008)


137-137: Do not perform function call Depends in argument defaults; instead, perform the call within the function, or read the default from a module-level singleton variable

(B008)


172-172: Do not perform function call Body in argument defaults; instead, perform the call within the function, or read the default from a module-level singleton variable

(B008)


173-173: Do not perform function call Depends in argument defaults; instead, perform the call within the function, or read the default from a module-level singleton variable

(B008)


206-206: Do not perform function call Depends in argument defaults; instead, perform the call within the function, or read the default from a module-level singleton variable

(B008)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (11)
routes/player_route.py (4)

33-33: Approved cache TTL formatting
The addition of CACHE_TTL = 600 # 10 minutes is clear, well-commented, and respects the 88-character limit enforced by Black.


42-42: Consistent tags parameter formatting
Trailing commas and aligned indentation in the tags=["Players"] lines improve readability and adhere to Black’s style.

Also applies to: 102-102, 133-133, 168-168


46-46: FastAPI dependency and body defaults
Using Depends(...) and Body(...) directly in endpoint signatures is idiomatic FastAPI. These can safely ignore Ruff B008 warnings.

Also applies to: 77-77, 137-137, 172-173, 206-206

🧰 Tools
🪛 Ruff (0.11.9)

46-46: Do not perform function call Depends in argument defaults; instead, perform the call within the function, or read the default from a module-level singleton variable

(B008)


153-155: Reformatted service call for readability
Splitting the retrieve_by_squad_number_async invocation across multiple lines keeps each line under 88 characters and improves clarity.

.vscode/settings.json (7)

7-8: Configure editor wrap and ruler
Setting "editor.wordWrapColumn": 88 and "editor.rulers": [88] aligns VSCode with Black’s configured line length.


10-12: Default formatter and format-on-save
Enabling the Black formatter (ms-python.black-formatter) with formatOnSave ensures consistent, automated formatting.


13-15: Switch to pytest
Disabling unittest and enabling pytest with the correct test directory reflects the project’s chosen test runner.


17-19: Flake8 invocation settings
Using "flake8.importStrategy": "fromEnvironment" and "flake8.path": ["${interpreter}", "-m", "flake8"] guarantees the linter runs against the project’s virtual environment.


20-27: Enforce Black-compatible Flake8 args
The arguments (--max-line-length=88, --max-complexity=10, --select=E,F,W, --extend-ignore=E203,W503, etc.) align Flake8 with Black’s formatting rules.


29-42: Define glob-based Flake8 ignores
Excluding directories/files that match Black’s exclude patterns (and per-file ignoring line-length violations in tests) reduces lint noise.


43-50: Customize Flake8 severity mapping
Mapping Flake8 error levels to VSCode severities (Error, Warning, Hint, Information) provides clear, editor-integrated feedback.

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@nanotaboada nanotaboada linked an issue May 25, 2025 that may be closed by this pull request
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🔭 Outside diff range comments (3)
routes/health_route.py (1)

16-16: ⚠️ Potential issue

Wrap docstring lines to respect 88-character limit
Current line exceeds the configured max line length (100 > 88), causing flake8 E501 failure.

Please apply the following diff to split the text:

-    Simple health check endpoint. Returns a JSON response with a single key "status" and value "ok".
+    Simple health check endpoint. Returns a JSON response with a single key "status"
+    and value "ok".
🧰 Tools
🪛 GitHub Actions: Python CI

[error] 16-16: flake8 E501: line too long (100 > 88 characters)

services/player_service.py (2)

30-30: ⚠️ Potential issue

Fix line length violation in docstring.

This line exceeds the 88-character limit (89 characters) and is causing pipeline failures. The docstring parameter description needs to be reformatted.

-        player_model (PlayerModel): The Pydantic model representing the Player to create.
+        player_model (PlayerModel): The Pydantic model representing the Player to 
+            create.
🧰 Tools
🪛 GitHub Actions: Python CI

[error] 30-30: flake8 E501: line too long (89 > 88 characters)


110-110: ⚠️ Potential issue

Fix line length violation in docstring.

This line exceeds the 88-character limit (89 characters) and is causing pipeline failures. The docstring parameter description needs to be reformatted.

-        player_model (PlayerModel): The Pydantic model representing the Player to update.
+        player_model (PlayerModel): The Pydantic model representing the Player to
+            update.
🧰 Tools
🪛 GitHub Actions: Python CI

[error] 110-110: flake8 E501: line too long (89 > 88 characters)

🧹 Nitpick comments (8)
routes/player_route.py (7)

45-47: Extract dependency defaults to module‐level constants.
Ruff B008 flags calling Body() and Depends() as defaults inside the signature.
Consider:

-from fastapi import Body, Depends
+from fastapi import Body, Depends

+# move these out of the signature
+_PLAYER_BODY = Body(...)
+_SESSION_DEP = Depends(generate_async_session)

 async def post_async(
-    player_model: PlayerModel = Body(...),
-    async_session: AsyncSession = Depends(generate_async_session),
+    player_model: PlayerModel = _PLAYER_BODY,
+    async_session: AsyncSession = _SESSION_DEP,
 ):

This removes function calls from default arguments.

🧰 Tools
🪛 Ruff (0.11.9)

45-45: Do not perform function call Body in argument defaults; instead, perform the call within the function, or read the default from a module-level singleton variable

(B008)


46-46: Do not perform function call Depends in argument defaults; instead, perform the call within the function, or read the default from a module-level singleton variable

(B008)


74-77: Extract Depends() from signature for get_all_async.
Apply the same module‐level constant refactor for the session dependency.

🧰 Tools
🪛 Ruff (0.11.9)

76-76: Do not perform function call Depends in argument defaults; instead, perform the call within the function, or read the default from a module-level singleton variable

(B008)


100-106: Extract Depends() in get_by_id_async.
Use the same _SESSION_DEP constant to satisfy Ruff B008.

🧰 Tools
🪛 Ruff (0.11.9)

105-105: Do not perform function call Depends in argument defaults; instead, perform the call within the function, or read the default from a module-level singleton variable

(B008)


127-136: Extract Depends() in get_by_squad_number_async.
Apply the module-level _SESSION_DEP for consistency.

🧰 Tools
🪛 Ruff (0.11.9)

135-135: Do not perform function call Depends in argument defaults; instead, perform the call within the function, or read the default from a module-level singleton variable

(B008)


161-170: Extract dependencies in put_async.
Move both Body(...) and Depends(...) calls to module constants.

🧰 Tools
🪛 Ruff (0.11.9)

169-169: Do not perform function call Body in argument defaults; instead, perform the call within the function, or read the default from a module-level singleton variable

(B008)


170-170: Do not perform function call Depends in argument defaults; instead, perform the call within the function, or read the default from a module-level singleton variable

(B008)


193-202: Extract Depends() in delete_async.
Refactor session dependency to _SESSION_DEP.

🧰 Tools
🪛 Ruff (0.11.9)

201-201: Do not perform function call Depends in argument defaults; instead, perform the call within the function, or read the default from a module-level singleton variable

(B008)


1-118: Docstring line-length violations.
The CI reports multiple E501 errors (lines 52, 118, 148, 177, 181, 211) due to docstring lines exceeding 88 characters.
Please reflow long docstrings or add explicit # noqa: E501 on those lines so that flake8 passes.

🧰 Tools
🪛 Ruff (0.11.9)

45-45: Do not perform function call Body in argument defaults; instead, perform the call within the function, or read the default from a module-level singleton variable

(B008)


46-46: Do not perform function call Depends in argument defaults; instead, perform the call within the function, or read the default from a module-level singleton variable

(B008)


76-76: Do not perform function call Depends in argument defaults; instead, perform the call within the function, or read the default from a module-level singleton variable

(B008)


105-105: Do not perform function call Depends in argument defaults; instead, perform the call within the function, or read the default from a module-level singleton variable

(B008)

🪛 GitHub Actions: Python CI

[error] 52-52: flake8 E501: line too long (89 > 88 characters)


[error] 118-118: flake8 E501: line too long (90 > 88 characters)

CONTRIBUTING.md (1)

13-16: Remove spaces inside code span elements for consistency
Per markdownlint MD038, avoid leading/trailing spaces inside backticks. Update these to `feat:`, `fix:`, and `chore:`.

🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

14-14: Spaces inside code span elements
null

(MD038, no-space-in-code)


15-15: Spaces inside code span elements
null

(MD038, no-space-in-code)


16-16: Spaces inside code span elements
null

(MD038, no-space-in-code)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 26e3e7d and 0e84a75.

📒 Files selected for processing (16)
  • .flake8 (1 hunks)
  • .github/workflows/python-app.yml (3 hunks)
  • .vscode/extensions.json (1 hunks)
  • .vscode/settings.json (1 hunks)
  • CONTRIBUTING.md (1 hunks)
  • databases/player_database.py (2 hunks)
  • main.py (3 hunks)
  • models/player_model.py (3 hunks)
  • pyproject.toml (1 hunks)
  • requirements-lint.txt (1 hunks)
  • routes/health_route.py (1 hunks)
  • routes/player_route.py (9 hunks)
  • schemas/player_schema.py (2 hunks)
  • services/player_service.py (5 hunks)
  • tests/player_stub.py (2 hunks)
  • tests/test_main.py (16 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (2)
routes/player_route.py (3)
models/player_model.py (1)
  • PlayerModel (32-60)
databases/player_database.py (1)
  • generate_async_session (35-43)
services/player_service.py (2)
  • retrieve_by_squad_number_async (82-98)
  • delete_async (139-158)
tests/test_main.py (2)
tests/player_stub.py (3)
  • existing_player (33-49)
  • nonexistent_player (52-68)
  • unknown_player (71-81)
tests/conftest.py (1)
  • client (11-22)
🪛 GitHub Actions: Python CI
routes/health_route.py

[error] 16-16: flake8 E501: line too long (100 > 88 characters)

models/player_model.py

[error] 26-26: flake8 E501: line too long (100 > 88 characters)


[error] 44-44: flake8 E501: line too long (93 > 88 characters)


[error] 47-47: flake8 E501: line too long (96 > 88 characters)

routes/player_route.py

[error] 52-52: flake8 E501: line too long (89 > 88 characters)


[error] 118-118: flake8 E501: line too long (90 > 88 characters)


[error] 148-148: flake8 E501: line too long (109 > 88 characters)


[error] 177-177: flake8 E501: line too long (89 > 88 characters)


[error] 181-181: flake8 E501: line too long (99 > 88 characters)


[error] 211-211: flake8 E501: line too long (99 > 88 characters)

services/player_service.py

[error] 30-30: flake8 E501: line too long (89 > 88 characters)


[error] 110-110: flake8 E501: line too long (89 > 88 characters)

🪛 Ruff (0.11.9)
routes/player_route.py

45-45: Do not perform function call Body in argument defaults; instead, perform the call within the function, or read the default from a module-level singleton variable

(B008)


46-46: Do not perform function call Depends in argument defaults; instead, perform the call within the function, or read the default from a module-level singleton variable

(B008)


76-76: Do not perform function call Depends in argument defaults; instead, perform the call within the function, or read the default from a module-level singleton variable

(B008)


105-105: Do not perform function call Depends in argument defaults; instead, perform the call within the function, or read the default from a module-level singleton variable

(B008)


135-135: Do not perform function call Depends in argument defaults; instead, perform the call within the function, or read the default from a module-level singleton variable

(B008)


169-169: Do not perform function call Body in argument defaults; instead, perform the call within the function, or read the default from a module-level singleton variable

(B008)


170-170: Do not perform function call Depends in argument defaults; instead, perform the call within the function, or read the default from a module-level singleton variable

(B008)


201-201: Do not perform function call Depends in argument defaults; instead, perform the call within the function, or read the default from a module-level singleton variable

(B008)

🪛 markdownlint-cli2 (0.17.2)
CONTRIBUTING.md

14-14: Spaces inside code span elements
null

(MD038, no-space-in-code)


15-15: Spaces inside code span elements
null

(MD038, no-space-in-code)


16-16: Spaces inside code span elements
null

(MD038, no-space-in-code)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (55)
requirements-lint.txt (1)

2-2: Add Black to linting requirements
Including black==25.1.0 alongside flake8 ensures code formatting consistency with Black across the project.

databases/player_database.py (3)

11-11: Insert blank line after module docstring
Adding a blank line improves readability and conforms to PEP 257/Black formatting style.


24-26: Reformat create_async_engine call
Switching to a single-line argument style aligns with Black's default formatting.


28-30: Reformat sessionmaker invocation
Adopting single-line parameters matches the project’s Black-enforced style.

models/player_model.py (2)

9-9: Add blank line after module docstring
This aligns spacing with Black's formatting conventions.


28-28: Add blank line before model_config
Improves readability and maintains consistency in class formatting.

routes/health_route.py (2)

7-7: Add blank line after module docstring
Conforms to the repository’s Black-driven spacing conventions.


12-12: Add blank line after router declaration
Improves separation between imports, router setup, and endpoint definitions.

.vscode/extensions.json (1)

5-5: Recommend Black formatter extension
Adding "ms-python.black-formatter" ensures the team can easily adopt Black in VSCode.

.vscode/settings.json (2)

10-11: Set editor wrap and ruler at 88 characters.
This aligns your VSCode environment with Black’s default maximum line length.


13-14: Switch default Python formatter to Black.
Using ms-python.black-formatter with format-on-save ensures consistent formatting across the team.

tests/player_stub.py (2)

18-18: Add trailing comma for consistency.
The added comma after starting11=None aligns with Black’s preferred trailing-comma style.


80-80: Add trailing comma after position.
Ensures the function call in unknown_player() follows Black’s multi-line comma convention.

main.py (3)

10-10: Insert blank line after module docstring.
This blank line improves separation between the docstring and imports per PEP 8.


21-21: Add blank line before @asynccontextmanager.
Enhances readability by visually separating imports from the decorator.


31-36: Reformat FastAPI instantiation into a multi-line call.
This styling change improves readability without altering behavior.

routes/player_route.py (2)

42-43: Approve added cache TTL constant.
Defining CACHE_TTL = 600 (10 minutes) is clear and readable.


42-42: Approve added tags=["Players"].
Consistent tagging on each route helps with OpenAPI organization.

pyproject.toml (2)

1-4: Add Black configuration section.
Defines a line length of 88, applies to .py/.pyi files, and targets Python 3.13.


3-3:

Details

✅ Verification successful

Verify Black’s target-version support.
Ensure that specifying 'py313' is recognized by the Black version in CI and locally.


🌐 Web query:

Does Black support specifying 'py313' in the `target-version` setting of `pyproject.toml`?

💡 Result:

As of Black version 23.1.0, released in January 2023, the --target-version option in the pyproject.toml configuration file accepts Python version identifiers in the format pyXY, where X and Y represent the major and minor version numbers, respectively. (ichard26.github.io)

Therefore, specifying py313 in the target-version setting of your pyproject.toml file is valid and will configure Black to format code compatible with Python 3.13.

For example, your pyproject.toml file would include:

[tool.black]
target-version = ['py313']

This configuration ensures that Black formats your code to be compatible with Python 3.13 syntax and features.

Citations:


Confirm Black’s py313 target-version support
Specifying

[tool.black]
target-version = ['py313']

is valid in Black v23.1.0+ and will format code for Python 3.13. No further changes required.

schemas/player_schema.py (1)

34-40: LGTM! String formatting aligns with Black standards.

The changes from single quotes to double quotes in SQLAlchemy column name parameters are purely stylistic and align with Black's formatting preferences. No functional changes were made.

.github/workflows/python-app.yml (3)

34-34: Good improvement to step naming clarity.

Renaming the step to "Install lint dependencies" improves workflow readability and clearly distinguishes between different dependency types.


43-45: Excellent addition of Black formatting enforcement.

Adding the Black formatting check to the CI pipeline ensures code consistency. Using black --check . is the correct approach for CI environments as it will fail the build if formatting issues are detected.


60-60: Good improvement to step naming clarity.

Renaming the step to "Install test dependencies" improves workflow readability and clearly distinguishes between different dependency types.

.flake8 (1)

2-7: Excellent flake8 configuration for Black integration.

The configuration changes properly align flake8 with Black formatting standards:

  • max-line-length = 88 matches Black's default
  • select = E,F,W enables comprehensive linting
  • extend-ignore = E203, W503 are standard Black compatibility ignores
  • Per-file ignore for tests allows reasonable flexibility

These are industry best practices for Black + flake8 integration.

services/player_service.py (2)

14-14: Good formatting improvement.

Adding blank lines after docstrings aligns with Black formatting standards and improves readability.


82-84: Good multi-line function signature formatting.

Breaking the function signature across multiple lines improves readability and aligns with Black's formatting for long function signatures.

CONTRIBUTING.md (9)

19-20: Approve logical commits guidance
The wording succinctly emphasizes grouping by purpose and squashing noise.


21-30: Approve Python formatting & style section
Clear instructions on using Black (88-char line length), flake8, and Python 3.13.x are correctly aligned with the project configuration.


31-33: Approve testing instructions
Explicitly running pytest and enforcing coverage non-regression matches CI requirements.


38-38: Approve rebase/squash guidance
Rebasing or squashing before opening keeps history clean.


40-42: Approve PR title & description guidelines
Conventional Commit format and concise “what & why” instructions are on point.


45-47: Approve issue reporting improvements
Encouraging search, clear repro steps, and focused issues is beneficial.


51-58: Approve automation & checks section
Listing commitlint, Black, flake8, and pytest ensures contributors know CI expectations.


62-63: Approve Code of Conduct & support section
References to CODE_OF_CONDUCT.md and discussion etiquette are clear.


65-67: Approve closing remarks
The separator and thank-you note effectively wrap up the guidelines.

tests/test_main.py (19)

27-35: Consistent test naming and docstring style
All test_given_* functions and their Given/when/then docstrings follow the project’s concise style conventions.


45-52: Approve GET /players/ initial request test rename
The function name and docstring have been updated for clarity and consistency.


61-67: Approve GET /players/ subsequent request test rename
Naming and docstring changes correctly reflect the scenario.


78-84: Approve GET /players/ no-ID status code test rename
The updated identifier and docstring align with the style guide.


92-98: Approve GET /players/ no-ID body test rename
Renaming improves readability without altering logic.


113-119: Approve GET nonexistent ID status code test rename
Consistent naming and concise docstring.


129-135: Approve GET existing ID status code test rename
Function name and docstring updates are spot on.


145-151: Approve GET existing ID body test rename
Clarity in naming/documentation enhances maintainability.


165-171: Approve GET nonexistent squad number status code test rename
Renamed identifier and docstring match project conventions.


181-187: Approve GET existing squad number status code test rename
Docstring and name are concise and clear.


197-203: Approve GET existing squad number body test rename
Naming consistency maintained.


217-223: Approve POST empty body status code test rename
Updated naming/docstring correctly reflect the test.


233-239: Approve POST existing player conflict test rename
The concise style is consistently applied.


250-256: Approve POST new player created test rename
Function name and docstring are improved for readability.


270-276: Approve PUT empty body status code test rename
Naming and docstring are aligned with guidelines.


287-293: Approve PUT unknown ID status code test rename
Clear and consistent naming/documentation.


305-311: Approve PUT existing ID no-content test rename
Maintains the concise Given/when/then pattern.


328-334: Approve DELETE unknown ID status code test rename
The update follows style conventions perfectly.


344-350: Approve DELETE existing ID no-content test rename
Function and docstring changes are consistent and clear.

@codacy-production
Copy link

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.00% 100.00%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (26e3e7d) 131 119 90.84%
Head commit (cc61d5a) 131 (+0) 119 (+0) 90.84% (+0.00%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#372) 3 3 100.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

@sonarqubecloud
Copy link

@codecov
Copy link

codecov bot commented May 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.65%. Comparing base (26e3e7d) to head (cc61d5a).
Report is 5 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #372   +/-   ##
=======================================
  Coverage   89.65%   89.65%           
=======================================
  Files           3        3           
  Lines         116      116           
=======================================
  Hits          104      104           
  Misses         12       12           
Components Coverage Δ
Services 79.31% <100.00%> (ø)
Routes 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@nanotaboada nanotaboada merged commit b05ac04 into master May 26, 2025
20 checks passed
@nanotaboada nanotaboada deleted the feature/black branch May 26, 2025 01:33
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.

Introduce black as the standard Python code formatter

2 participants