Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@ayakut16
Copy link
Contributor

@ayakut16 ayakut16 commented Apr 5, 2025

Description

This PR moves the commands into their own files and also adds tests for some of the commands.

The test coverage increased from 7% -> 17%.

  • Before:
ok      github.com/f/mcptools/cmd/mcptools      (cached)        coverage: 7.2% of statements
  • After:
ok      github.com/f/mcptools/cmd/mcptools      0.809s  coverage: 16.7% of statements
ok      github.com/f/mcptools/cmd/mcptools/commands     1.125s  coverage: 17.0% of statements

Test coverage is still quite low imo, I couldn't add tests for all cases because I realised some of the commands are not working as intended e.g. resources, call prompt etc.

I also didn't add tests for shell, new and proxy commands as I didn't want to complicate this PR more. However adding tests for them should increase the overall coverage quite a lot.

Fixes #19

Type of change

Refactor

How Has This Been Tested?

  • Unit tests.
  • I run the commands manually: It would be good for reviewer to give it a try as well (at least for most common usecases) to make sure nothing is borken

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@ayakut16 ayakut16 force-pushed the refactor/commands branch from 4674b36 to e0e0d64 Compare April 5, 2025 01:55
@f f merged commit a906e6a into f:master Apr 5, 2025
2 checks passed
@ayakut16 ayakut16 deleted the refactor/commands branch April 5, 2025 18:37
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.

Refactor main.go to modular subcommands in commands/ directory

2 participants