Skip to content

Conversation

@bnbong
Copy link
Owner

@bnbong bnbong commented Sep 14, 2025

Requesting Merging

Description

  • fix console object searching error
  • add console size adjustment feature
    • now, fastkit output appropriately adjusted according to the size of the user console(terminal).

Type of Change

  • BUG FIX
  • ADDING NEW TEMPLATE
  • FEATURE ADDED/UPDATED
  • HOTFIX
  • DELETING UNNECESSARY FEATURES
  • DOCUMENTATION & DEVOPS
  • Etc..

Test Environment

local, M1 Mac

Major Changes

same as above

Screenshots (optional)

Etc

close #17

… output size feature via size of user console
@bnbong bnbong requested a review from Copilot September 14, 2025 08:07
@bnbong bnbong self-assigned this Sep 14, 2025
@bnbong bnbong added bug Something isn't working enhancement New feature or request fix Fix or improve source codes labels Sep 14, 2025
@github-actions github-actions bot added the template Add or editing a FastAPI template label Sep 14, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes console object searching errors and adds console size adjustment features to ensure FastAPI-fastkit output is appropriately sized according to the user's terminal dimensions.

  • Refactored console object imports from a global module to utils.main module
  • Added adaptive console sizing functionality with terminal dimension detection
  • Enhanced table and panel components to prevent text truncation and ensure proper content display

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/fastapi_fastkit/init.py Removed global console object and simplified module initialization
src/fastapi_fastkit/utils/main.py Added console sizing functions and adaptive panel/table creation with proper width calculations
src/fastapi_fastkit/cli.py Updated console imports and modified template listing to use new table creation approach
src/fastapi_fastkit/backend/package_managers/*.py Fixed console imports to use the new console object from utils.main
tests/test_utils.py Updated test mocks to use correct console object path
tests/test_backends/test_console_sizing.py Added comprehensive tests for new console sizing functionality
.github/workflows/distribute.yml Minor formatting improvement in workflow file
Comments suppressed due to low confidence (1)

src/fastapi_fastkit/utils/main.py:195

  • The console parameter is unused in this function but still accepted as an argument. Consider removing it since the function doesn't use the console parameter for any operations.
    title: str,
    data: Optional[Dict[str, str]] = None,
    show_header: bool = False,
    console: Console = console,
) -> Table:
    """
    Create a table for displaying information that never truncates text.

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

REGEX = r"\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,7}\b"


def get_optimal_console_size() -> tuple[int, int]:
Copy link

Copilot AI Sep 14, 2025

Choose a reason for hiding this comment

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

Use Tuple[int, int] from typing module instead of tuple[int, int] for better compatibility with older Python versions. The lowercase tuple annotation requires Python 3.9+.

Copilot uses AI. Check for mistakes.
@codecov
Copy link

codecov bot commented Sep 14, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@bnbong bnbong merged commit 6d0c868 into main Sep 14, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request fix Fix or improve source codes template Add or editing a FastAPI template

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fastkit artifact of Pypi package's has console object not found error

2 participants