Skip to content

Conversation

@flamehaven01
Copy link
Owner

Summary

  • remove unused imports and unused exception variable flagged by ruff
  • fix example prints to avoid empty f-strings

Testing

  • ruff check .

Codex Task

Copilot AI review requested due to automatic review settings December 15, 2025 08:04
@flamehaven01 flamehaven01 merged commit 4fd20f3 into main Dec 15, 2025
5 checks passed
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses lint issues identified by ruff, removing unused code and fixing unnecessary f-string usage.

  • Removed unused import statements (re and Optional)
  • Removed unused exception variable in error handling
  • Fixed empty f-strings that should be regular strings

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/dir2md/spicy.py Removed unused re import and unused exception variable e in error handling
src/dir2md/query/suggester.py Fixed two empty f-strings to regular strings in print statements
src/dir2md/compressors/gravitas.py Removed unused imports Optional and re

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

flamehaven01 pushed a commit that referenced this pull request Dec 18, 2025
Complete SIDRCE Spicy Audit response with advanced configuration system.

## Security & Reliability Fixes (5/5 Issues Resolved)

CRITICAL: Markdown Fence Injection (Issue #5)
- Implemented dynamic fence escaping that counts consecutive backticks
- Prevents markdown structure corruption and injection attacks
- Files: src/dir2md/markdown.py

HIGH: Subprocess RCE Vector (Issue #1)
- Removed vulture subprocess.run() call completely
- Eliminates security risk and unreliable external dependency
- Files: src/dir2md/spicy.py

MEDIUM: Silent Exception Failures (Issue #2)
- Replaced bare except with specific exception handling
- Added logging.warning() for .env load failures
- Files: src/dir2md/cli.py

LOW: Aggressive Glob Expansion (Issue #3)
- Removed automatic pattern expansion (foo/ -> [foo/, **/foo, ...])
- Now respects gitignore standard and user intent
- Files: src/dir2md/walker.py

LOW: Hardcoded DEFAULT_EXCLUDES (Issue #4)
- Moved to external defaults.json file
- Removed personal preferences (.pytest_cache_local)
- Added graceful fallback mechanism
- Files: src/dir2md/cli.py, src/dir2md/defaults.json (new)

## Advanced Configuration System

Three-tier Priority System:
1. System defaults (lowest): defaults.json or --defaults-file
2. Project config (medium): pyproject.toml [tool.dir2md.excludes]
3. User CLI (highest): --exclude-glob

New Features:
- --defaults-file CLI argument for custom defaults path
- pyproject.toml [tool.dir2md.excludes] support
- Priority-based exclude pattern merging

## Testing & Quality

- All tests passing: 22/22 (100%)
- Code coverage: 55% overall, 87-95% on patched modules
- Build verified: tar.gz + wheel with defaults.json included
- Backward compatibility: 100% maintained

## Grade Improvement

SIDRCE Spicy Audit: C+ -> A (90-94 points)
- Security: C -> A+
- Reliability: B- -> A
- Performance: B -> A
- Maintainability: C+ -> A
- Configuration: D -> A+

Production ready.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant