Skip to content

fixed main issue for cli.py and added classes and objects to the code - #36

Closed
YuvrajShekhar wants to merge 2 commits into
ferrix-lab:mainfrom
YuvrajShekhar:main
Closed

fixed main issue for cli.py and added classes and objects to the code#36
YuvrajShekhar wants to merge 2 commits into
ferrix-lab:mainfrom
YuvrajShekhar:main

Conversation

@YuvrajShekhar

Copy link
Copy Markdown

Description

Fixed two issues in insight/cli.py:

  1. Added the if name == "main": main() entry point so the CLI runs correctly when executed directly or with python -m insight.cli.
  2. Changed the invalid path handling to exit with status code 1 instead of returning with status code 0.

Why

Previously, running cli.py directly would exit without executing main(). Additionally, an invalid target path was treated as a successful execution because the process returned with exit code 0.

These changes ensure the CLI behaves correctly when executed directly and properly reports failures to CI pipelines and automated scripts.

Type of Change

Please mark the relevant option(s) with an x:

  • Bug fix (non-breaking change fixing an issue)
  • New feature (non-breaking change adding functionality)
  • Breaking change (fix or feature causing existing functionality to change)
  • Documentation update
  • Performance improvement
  • Tests (adding missing tests or fixing existing tests)
  • Refactoring / Code cleanup

Checklist

  • My code follows the style guidelines of this project (PEP 8 / ruff).
  • I have performed a self-review of my own code.
  • I have commented my code where necessary, particularly in non-obvious sections.
  • I have updated the documentation accordingly (if applicable).
  • I have added tests that prove my fix is effective or that my feature works (if applicable).
  • All new and existing tests pass locally.
  • My changes generate no new warnings or unhandled exceptions.

@CodeMaverick-143

Copy link
Copy Markdown
Contributor

@YuvrajShekhar resolve conflicts

@YuvrajShekhar

Copy link
Copy Markdown
Author

@CodeMaverick-143 I have resolved conflicts.

Kept the Insight class structure (current branch) over the standalone-function (incoming branch). The functions run() and get_version() are called as methods elsewhere in the file, so the class-based version was correct.

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.

2 participants