Skip to content

Conversation

@shivasurya
Copy link
Owner

Summary

Final PR in the output standardization stack. Removes deprecated query and analyze commands and adds comprehensive documentation for all output formats, verbosity levels, and exit codes.

Changes

Deprecated Commands Removed

  • cmd/query.go - Removed entirely
  • cmd/query_test.go - Removed entirely
  • cmd/analyze.go - Removed entirely
  • main_test.go - Updated to remove references to deprecated commands

BREAKING CHANGE: No backward compatibility provided per requirements.

Documentation Updates

README.md

  • Usage Examples: Scan and CI command examples
  • Output Formats: Text, JSON, CSV, SARIF examples with real output
  • Verbosity Levels: Table showing default/verbose/debug behavior
  • Exit Codes: Table and examples for exit code 0, 1, 2

docs/CLI.md (New)

  • Command Reference: Complete flag documentation for all commands
  • Output Format Reference: JSON schema, CSV columns, SARIF features
  • Exit Code Reference: Detailed exit code behavior and --fail-on syntax

Verification Tests

  • cmd/command_cleanup_test.go: Integration tests verifying:
    • query command returns "unknown command"
    • analyze command returns "unknown command"
    • Help text no longer mentions removed commands

Test Results

All tests passing ✅

$ gradle testGo
ok  	.../cmd	0.343s

$ ./build/go/pathfinder query
Error: unknown command "query" for "pathfinder"

$ ./build/go/pathfinder analyze
Error: unknown command "analyze" for "pathfinder"

$ ./build/go/pathfinder --help | grep -E "(query|analyze)"
# (no output - commands not shown)

Documentation Examples

Scan Command

pathfinder scan --rules rules/ --project /path/to/project
pathfinder scan --rules rules/ --project . --verbose
pathfinder scan --rules rules/ --project . --fail-on=critical,high

CI Command

pathfinder ci --rules rules/ --project . --output json > results.json
pathfinder ci --rules rules/ --project . --output sarif > results.sarif
pathfinder ci --rules rules/ --project . --output csv --fail-on=critical

Exit Code Behavior

# Default: always exit 0
pathfinder scan --rules rules/ --project .
echo $?  # 0 even with findings

# Fail on critical or high
pathfinder scan --rules rules/ --project . --fail-on=critical,high
echo $?  # 1 if critical/high found, 0 otherwise

Migration Notes

Breaking Changes

  • query command removed: Use scan command instead
  • analyze command removed: Use scan or ci command instead
  • No migration path provided per requirements

Non-Breaking

  • All existing scan and ci commands continue to work
  • Documentation is backwards compatible

Checklist

  • query command removed
  • analyze command removed
  • main_test.go updated
  • Verification tests added
  • README.md updated with comprehensive docs
  • docs/CLI.md created
  • All tests passing
  • Linter passing
  • Binary builds successfully
  • Help text verified

Stacked PRs

This PR stacks on top of:

This is the final PR in the output standardization feature stack.

Verification

Commands removed successfully:

$ ./build/go/pathfinder query
Error: unknown command "query" for "pathfinder"

$ ./build/go/pathfinder analyze
Error: unknown command "analyze" for "pathfinder"

Valid commands work:

$ ./build/go/pathfinder scan --help
# Shows scan command help

$ ./build/go/pathfinder ci --help
# Shows ci command help

🤖 Generated with Claude Code

@safedep
Copy link

safedep bot commented Nov 22, 2025

SafeDep Report Summary

Green Malicious Packages Badge Green Vulnerable Packages Badge Green Risky License Badge

No dependency changes detected. Nothing to scan.

This report is generated by SafeDep Github App

@shivasurya shivasurya force-pushed the shiva/output-command-cleanup branch 3 times, most recently from ce2bb20 to f3b3028 Compare November 22, 2025 00:34
@codecov
Copy link

codecov bot commented Nov 22, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.70%. Comparing base (0e246ee) to head (4d2c8ec).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #397      +/-   ##
==========================================
+ Coverage   79.76%   80.70%   +0.94%     
==========================================
  Files          79       77       -2     
  Lines        7846     7736     -110     
==========================================
- Hits         6258     6243      -15     
+ Misses       1343     1248      -95     
  Partials      245      245              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Owner Author

shivasurya commented Nov 22, 2025

Merge activity

  • Nov 22, 12:38 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Nov 22, 12:47 AM UTC: Graphite rebased this pull request as part of a merge.
  • Nov 22, 12:48 AM UTC: @shivasurya merged this pull request with Graphite.

@shivasurya shivasurya changed the base branch from shiva/output-exit-codes to graphite-base/397 November 22, 2025 00:45
@shivasurya shivasurya changed the base branch from graphite-base/397 to main November 22, 2025 00:46
shivasurya and others added 3 commits November 22, 2025 00:47
No backward compatibility per requirements.
Users should use 'scan' or 'ci' commands instead.

BREAKING CHANGE: query and analyze commands removed

Part of output standardization feature.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
- Output format examples (text, JSON, CSV, SARIF)
- Verbosity level documentation
- Exit code behavior table
- Usage examples for all commands

Part of output standardization feature.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
- Complete flag documentation for all commands
- Output format reference with schemas
- Exit code reference table
- Usage examples

Part of output standardization feature.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@shivasurya shivasurya force-pushed the shiva/output-command-cleanup branch from 4de4e85 to 4d2c8ec Compare November 22, 2025 00:47
@shivasurya shivasurya merged commit ae24035 into main Nov 22, 2025
3 checks passed
@shivasurya shivasurya deleted the shiva/output-command-cleanup branch November 22, 2025 00:48
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