-
Notifications
You must be signed in to change notification settings - Fork 1
Improve error message when scan target path doesn't exist #3
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed
Description
Problem
When you run malwar scan /nonexistent/path, the error message is a Python traceback rather than a friendly CLI error. Users should see a clear message like:
Error: Path '/nonexistent/path' does not exist.
How to Fix
- Open
src/malwar/cli/app.py— thescancommand handler - Add a path existence check before the scan begins
- Use
typer.BadParameterorrich.console.printwith[red]styling for a clean error - Also handle the case where the path exists but contains no
.mdfiles (currently says "No .md files found" which is good, but could suggest checking the path)
Testing
Add a test in tests/ that verifies:
- Scanning a nonexistent path gives a clear error message and exit code 1
- Scanning an empty directory gives a helpful message
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed