Skip to content

Fix #5 which prevents tool from running along with other cleanup#10

Open
clach04 wants to merge 5 commits intoJeffCarpenter:masterfrom
clach04:mine
Open

Fix #5 which prevents tool from running along with other cleanup#10
clach04 wants to merge 5 commits intoJeffCarpenter:masterfrom
clach04:mine

Conversation

@clach04
Copy link
Copy Markdown

@clach04 clach04 commented Jun 17, 2025

Summary by Sourcery

Apply fixes for parameter name preservation (#5) and missing user error display (#9), streamline argument parsing in main(), and refresh README with installation and usage instructions including Windows and token notes.

Bug Fixes:

Enhancements:

  • Consolidate argument parsing into the main function to simplify setup and handling

Documentation:

  • Add installation steps, Windows environment variable advice, token requirement warning, and checkout-friendly usage examples to README

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai bot commented Jun 17, 2025

Reviewer's Guide

This PR inlines the CLI argument parser into the main entrypoint to preserve existing parameter names, enhances missing-user error handling by printing usage and exiting with an error code, and overhauls the README with clear installation steps, Windows-specific notes, token guidance, and corrected usage examples.

Class diagram for updated CLI argument parsing in export_stars.py

classDiagram
    class ArgumentParser {
        +add_argument()
        +parse_args()
        +print_usage()
    }
    class Args {
        +user
        +token
    }
    class main {
        +main()
    }
    ArgumentParser <.. main : uses
    Args <.. main : uses
Loading

File-Level Changes

Change Details Files
Refactor CLI argument parsing into main and improve usage error handling
  • Eliminate separate parse_args function
  • Inline ArgumentParser instantiation and parsing within main
  • Map --user and --github-token to user and token attributes
  • Print usage and newline before error message on missing user
  • Terminate with exit code 1 when user is not provided
export_stars/export_stars.py
Revamp README with installation, Windows notes, and updated usage examples
  • Add pip install commands for setting up dependencies
  • Include Windows UTF-8 environment variable note
  • Explain when a GitHub token is required to avoid rate limits
  • Update usage examples to reference export_stars module path
readme.md

Assessment against linked issues

Issue Objective Addressed Explanation
#9 Fix the spelling mistake 'repositorys' to 'repositories' in the help message.

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@clach04
Copy link
Copy Markdown
Author

clach04 commented Jun 17, 2025

I do have separate branches for some of these if someone wants to cherry-pick. Sharing in one PR for convenience.

Thanks for this tool, along with the existing PRs this builds upon 🙏

Copy link
Copy Markdown

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @clach04 - I've reviewed your changes - here's some feedback:

  • The README incorrectly uses "-i requirements.txt" instead of "-r requirements.txt" for installing dependencies and duplicates the install step—please fix and simplify those instructions.
  • Consider refactoring the argument parsing back into a separate parse_args() function for better readability and easier testing rather than inlining it in main().
  • Please add an example in the README showing use of the --github-token flag and/or catch RateLimitExceededException in code to display a more informative error if the API limit is hit.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The README incorrectly uses "-i requirements.txt" instead of "-r requirements.txt" for installing dependencies and duplicates the install step—please fix and simplify those instructions.
- Consider refactoring the argument parsing back into a separate `parse_args()` function for better readability and easier testing rather than inlining it in `main()`.
- Please add an example in the README showing use of the `--github-token` flag and/or catch `RateLimitExceededException` in code to display a more informative error if the API limit is hit.

## Individual Comments

### Comment 1
<location> `readme.md:5` </location>
<code_context>
-Usage: `GH_USER=defunkt python3 export_stars.py > stars.csv`
+Setup:
+
+    python -m pip install -i requirements.txt
+    pip install -i requirements.txt
+
+Usage:
</code_context>

<issue_to_address>
Incorrect pip install flag; should use '-r' instead of '-i' for requirements file.

Replace '-i' with '-r' in both install commands to correctly reference the requirements file.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@clach04
Copy link
Copy Markdown
Author

clach04 commented Jun 17, 2025

Experiment, @sourcery-ai review as it already found a problem without me asking it to :-)

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.

spelling mistake in help, repositorys

2 participants