skyl / corpora

Corpora is a self-building corpus that can help build other arbitrary corpora
GNU Affero General Public License v3.0
2 stars 0 forks source link

feat(rs/core/corpora_cli): framing the new CLI #49

Closed skyl closed 5 days ago

skyl commented 5 days ago

PR Type

Enhancement, Configuration changes


Description


Changes walkthrough ๐Ÿ“

Relevant files
Enhancement
init.rs
Add new `init` command to CLI                                                       

rs/core/corpora_cli/src/commands/init.rs
  • Added a new init command with a basic implementation.
  • Prints a message when executed with no arguments.
  • +4/-0     
    mod.rs
    Update CLI commands: add `init`, `sync`, `workon`               

    rs/core/corpora_cli/src/commands/mod.rs
  • Removed corpus command.
  • Added init, sync, and workon commands.
  • Updated the Commands enum to include new commands.
  • +6/-3     
    sync.rs
    Add new `sync` command to CLI                                                       

    rs/core/corpora_cli/src/commands/sync.rs
  • Added a new sync command with a basic implementation.
  • Prints a message when executed with no arguments.
  • +4/-0     
    workon.rs
    Add new `workon` command with path argument                           

    rs/core/corpora_cli/src/commands/workon.rs
  • Added a new workon command with argument handling.
  • Prints a message with the provided path argument.
  • +14/-0   
    main.rs
    Update main CLI to integrate new commands                               

    rs/core/corpora_cli/src/main.rs
  • Updated main CLI to use new commands.
  • Removed corpus command handling.
  • Added handling for init, sync, and workon commands.
  • +4/-2     
    Configuration changes
    ci-python.yml
    Update CI to trigger on main branch push                                 

    .github/workflows/ci-python.yml - Added trigger for CI on push to the main branch.
    +3/-0     
    ci-rust.yml
    Update CI to trigger on main branch push                                 

    .github/workflows/ci-rust.yml - Added trigger for CI on push to the main branch.
    +3/-0     

    ๐Ÿ’ก PR-Agent usage: Comment /help "your question" on any pull request to receive relevant information

    github-actions[bot] commented 5 days ago

    PR Reviewer Guide ๐Ÿ”

    Here are some key observations to aid the review process:

    โฑ๏ธ Estimated effort to review: 2 ๐Ÿ”ต๐Ÿ”ตโšชโšชโšช
    ๐Ÿงช No relevant tests
    ๐Ÿ”’ No security concerns identified
    โšก Recommended focus areas for review

    Code Smell
    The `init` command implementation currently only prints a message and does not perform any actual initialization logic. Consider implementing the intended functionality or adding a TODO comment. Code Smell
    The `sync` command implementation currently only prints a message and does not perform any actual synchronization logic. Consider implementing the intended functionality or adding a TODO comment. Code Smell
    The `workon` command implementation only prints the path and does not perform any actual work on the specified path. Consider implementing the intended functionality or adding a TODO comment.
    github-actions[bot] commented 5 days ago

    PR Code Suggestions โœจ

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Score
    Possible issue
    Validate the path argument in the workon command to ensure it is valid ___ **Validate the path argument in the workon command to ensure it points to a valid file
    or directory, improving robustness.** [rs/core/corpora_cli/src/commands/workon.rs [13]](https://github.com/skyl/corpora/pull/49/files#diff-e8486ee89ebf16ff450393704ed1bda8ca8222231ba8dc254270317294b85a76R13-R13) ```diff -println!("Workon command executed with path: {}", args.path); +if Path::new(&args.path).exists() { + println!("Workon command executed with path: {}", args.path); +} else { + eprintln!("Invalid path: {}", args.path); +} ```
    Suggestion importance[1-10]: 8 Why: Validating the `path` argument in the `workon` command improves robustness by ensuring the path is valid before proceeding. This is a significant enhancement that can prevent runtime errors.
    8
    Enhancement
    Add argument parsing to the init command for enhanced functionality ___ **Consider implementing argument parsing for the init command to allow for future
    enhancements and flexibility in handling different scenarios.** [rs/core/corpora_cli/src/commands/init.rs [2-4]](https://github.com/skyl/corpora/pull/49/files#diff-f464032a0fce74f27bdd1392052016915cccb793e821d99be68c5d830829d0d4R2-R4) ```diff -pub fn run() { - println!("init command executed with no arguments."); +pub fn run(args: InitArgs) { + println!("init command executed with arguments: {:?}", args); } ```
    Suggestion importance[1-10]: 5 Why: Adding argument parsing to the `init` command can enhance its functionality and flexibility for future extensions. However, without specific requirements or use cases, the immediate impact is moderate.
    5
    Enhance the sync command by adding argument parsing capabilities ___ **Implement argument parsing for the sync command to support additional features and
    options in the future.** [rs/core/corpora_cli/src/commands/sync.rs [2-4]](https://github.com/skyl/corpora/pull/49/files#diff-95450b4ef279cd2f15cef75ca2ae11addb7aee0dddb6c9a63dc05c069604200dR2-R4) ```diff -pub fn run() { - println!("sync command executed with no arguments."); +pub fn run(args: SyncArgs) { + println!("sync command executed with arguments: {:?}", args); } ```
    Suggestion importance[1-10]: 5 Why: Similar to the `init` command, adding argument parsing to the `sync` command can provide flexibility for future enhancements. The suggestion is valid but has a moderate impact without specific use cases.
    5