Skip to content

update from head repo#6

Open
Onyx-Nostalgia wants to merge 27 commits intoOnyx-Nostalgia:mainfrom
johnthagen:main
Open

update from head repo#6
Onyx-Nostalgia wants to merge 27 commits intoOnyx-Nostalgia:mainfrom
johnthagen:main

Conversation

@Onyx-Nostalgia
Copy link
Owner

No description provided.

@gemini-code-assist
Copy link

Summary of Changes

Hello @Onyx-Nostalgia, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request primarily focuses on updating development dependencies and tools, specifically upgrading the uv version and migrating the documentation generation system. It also includes a refactor of the CLI testing approach and various minor formatting and cleanup changes across the codebase.

Highlights

  • Dependency Updates: The uv version in the Dockerfile has been updated from 0.8.3 to 0.8.22. Additionally, the documentation generation tools have been switched from mkdocs-gen-files and mkdocs-literate-nav to mkdocs-api-autonav in both mkdocs.yml and pyproject.toml.
  • Testing Improvements: The CLI tests in tests/test_cli.py have been refactored to use typer.testing.CliRunner for more integrated and robust testing, replacing the previous subprocess based approach.
  • Documentation Structure Changes: The docs/gen_ref_pages.py file, which was used for automatic code reference page generation, has been removed as part of the switch to mkdocs-api-autonav. The mkdocs.yml configuration was updated to reflect this change and to include the navigation.indexes feature.
  • Minor Formatting and Cleanup: Several minor formatting adjustments, whitespace corrections, and a pragma comment update (no branch to no cover) were made across README.md, docs/index.md, and src/fact/cli.py.
Ignored Files
  • Ignored by pattern: .github/workflows/** (2)
    • .github/workflows/ci.yml
    • .github/workflows/pages.yml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request includes a number of valuable updates and refactorings, such as updating dependencies, improving documentation generation, and modernizing the CLI tests. The changes are well-executed and enhance the project's maintainability. I have one suggestion to further improve the test coverage for the command-line interface.

Comment on lines 5 to +12
def test_main() -> None:
"""Test the main function of the CLI."""

# Run the CLI command
result = subprocess.run(
[sys.executable, "-m", "fact.cli", "5"],
capture_output=True,
text=True,
)

# Check the output
assert result.returncode == 0
assert "fact(5) = 120" in result.stdout
runner = CliRunner()
result = runner.invoke(app, ["5"])
assert result.exit_code == 0
assert "fact(5) = 120" in result.output

Choose a reason for hiding this comment

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

medium

The test for the CLI is much improved by using CliRunner. However, it currently only covers a single happy path scenario. To make the tests more robust, I'd recommend parameterizing the test to cover edge cases and invalid inputs.

For example, you could test:

  • The factorial of 0 (fact(0) = 1).
  • Invalid input, such as a negative number, which should be handled by Typer's validation (min=0) and result in a non-zero exit code.

Here's a suggestion using pytest.mark.parametrize. You'll also need to add import pytest at the top of the file.

Suggested change
def test_main() -> None:
"""Test the main function of the CLI."""
# Run the CLI command
result = subprocess.run(
[sys.executable, "-m", "fact.cli", "5"],
capture_output=True,
text=True,
)
# Check the output
assert result.returncode == 0
assert "fact(5) = 120" in result.stdout
runner = CliRunner()
result = runner.invoke(app, ["5"])
assert result.exit_code == 0
assert "fact(5) = 120" in result.output
@pytest.mark.parametrize(
("args", "expected_output", "expected_exit_code"),
[
(["5"], "fact(5) = 120\n", 0),
(["0"], "fact(0) = 1\n", 0),
# Typer exits with 2 for validation errors.
(["-1"], "Invalid value for 'N'", 2),
],
)
def test_main(args: list[str], expected_output: str, expected_exit_code: int) -> None:
"""Test the main function of the CLI with various inputs."""
runner = CliRunner()
result = runner.invoke(app, args)
assert result.exit_code == expected_exit_code
assert expected_output in result.output

@Onyx-Nostalgia Onyx-Nostalgia self-assigned this Oct 8, 2025
@Onyx-Nostalgia Onyx-Nostalgia added the enhancement New feature or request label Oct 8, 2025
Copilot AI and others added 16 commits October 8, 2025 08:08
…310)

* Add Python 3.14 support and update default to 3.13

Co-authored-by: johnthagen <10340167+johnthagen@users.noreply.github.com>

* Update Dockerfile to Python 3.13 and drop Python 3.9 support

Co-authored-by: johnthagen <10340167+johnthagen@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: johnthagen <10340167+johnthagen@users.noreply.github.com>
* Update Dockerfile to use Debian trixie container images

Co-authored-by: johnthagen <10340167+johnthagen@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: johnthagen <10340167+johnthagen@users.noreply.github.com>
* Initial plan

* Update GitHub Actions to latest major versions

- Bump actions/checkout from v4 to v5
- Bump astral-sh/setup-uv from v5 to v7
- Bump actions/setup-python from v5 to v6
- Keep docker/build-push-action at v6 (already latest major)

Co-authored-by: johnthagen <10340167+johnthagen@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: johnthagen <10340167+johnthagen@users.noreply.github.com>
on: [push, pull_request]

permissions:
contents: read

Check notice

Code scanning / SonarCloud

Read permissions should be defined at the job level Low

Move this read permission from workflow level to job level. See more on SonarQube Cloud
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
5 Security Hotspots
C Security Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants