Skip to content

fix: cross-platform support — remove grep/find dependency (#7)#8

Merged
peteromallet merged 1 commit intomainfrom
fix/windows-cross-platform
Feb 12, 2026
Merged

fix: cross-platform support — remove grep/find dependency (#7)#8
peteromallet merged 1 commit intomainfrom
fix/windows-cross-platform

Conversation

@peteromallet
Copy link
Owner

Summary

  • Replaces all Unix grep/find subprocess calls with pure-Python equivalents (os.walk, re module), eliminating the dependency on GNU tools — fixes the Windows FileNotFoundError crash
  • Fixes auto_detect_lang() to only return languages with registered plugins (prevents ValueError: Unknown language: 'go' when go.mod present)
  • Adds DEFAULT_EXCLUSIONS that prune common non-source dirs (node_modules, .git, __pycache__, .venv, dist, build, .tox, .mypy_cache, etc.) during traversal rather than post-search, improving scan performance on large trees
  • File discovery is ~10x faster (no subprocess spawn overhead)
  • Overall scan time unchanged or slightly faster on our test codebase

What changed

File Change
utils.py Replace find subprocess with os.walk; add grep_files(), grep_files_containing(), grep_count_files() pure-Python utilities; add DEFAULT_EXCLUSIONS
lang/__init__.py auto_detect_lang() now checks _registry before returning a language
lang/typescript/detectors/logs.py Use grep_files() instead of subprocess grep
lang/typescript/detectors/exports.py Use grep_files() + grep_files_containing() instead of subprocess grep + temp pattern files
lang/typescript/detectors/deprecated.py Use grep_files() + grep_count_files() instead of subprocess grep
lang/typescript/detectors/deps.py Use grep_files() + find_ts_files() instead of run_grep(["grep", ...])
lang/python/detectors/deps.py Use grep_files() + find_py_files() instead of run_grep(["grep", ...])
visualize.py Use find_ts_files() instead of subprocess find

Test plan

  • Verified scan produces same finding counts on our codebase
  • Verified --exclude flag still works correctly
  • Verified auto_detect_lang returns None for go-only dirs, python for go+python dirs
  • Verified all modules import cleanly
  • Windows testing by issue reporter

Closes #7

🤖 Generated with Claude Code

…(Issue #7)

Replace all Unix grep/find subprocess calls with pure-Python equivalents
(os.walk, re module) so desloppify works on Windows without GNU tools.

- Replace `find` with os.walk in file discovery, pruning excluded dirs
  during traversal for better performance
- Add grep_files(), grep_files_containing(), grep_count_files() utilities
  as cross-platform replacements for subprocess grep
- Convert all TypeScript detectors (logs, exports, deprecated, deps) and
  Python dep graph builder to use new pure-Python search functions
- Fix auto_detect_lang() to only return languages with registered plugins
  (prevents crash when go.mod detected but no Go plugin exists)
- Add DEFAULT_EXCLUSIONS for common non-source dirs (node_modules, .git,
  __pycache__, .venv, dist, build, .tox, .mypy_cache, etc.)
- Update visualize.py to use find_ts_files() instead of subprocess find

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@peteromallet peteromallet merged commit 6f8aa88 into main Feb 12, 2026
@peteromallet peteromallet deleted the fix/windows-cross-platform branch February 12, 2026 17:58
peteromallet added a commit that referenced this pull request Feb 22, 2026
…st coverage

Quick fixes:
- Add blank line after PrimaryAction TypedDict (#3)
- Fix _compute_risk_flags local type: list[dict] → list[RiskFlag] (#11)
- Hoist dimension_action_type dicts to module-level constants (#17)

Import path cleanup:
- Remove underscore aliases in _work_queue/core.py and ranking.py (#12)

Type safety:
- Add WorkQueueResult TypedDict for build_work_queue return (#5)
- Change build_work_queue state param to StateModel (#5)

Structural refactors:
- Move scorecard_dimension_rows to engine/planning/dimension_rows.py (#2)
- Replace importlib.import_module with deferred imports in _state/ (#9)
- Extract 13 TypedDicts from narrative/core.py to narrative/types.py (#13)
- Derive _DIMENSION_SPECS from detector registry instead of manual tuple (#18)

Abstraction fitness:
- Remove 16 file_discovery and 3 text_utils re-exports from utils.py (#6)
- Update 12 consumer files to import from source modules directly

AI-generated debt:
- Simplify 46 Google-style docstrings across 18 production files (#7)

Test improvements:
- Add 73 targeted tests for concerns.py internal generators (#15)
- Split smoke test monolith into 6 per-subsystem functions (#16)

Also resolved 4 findings already fixed in current code (#1, #8, #10, #14).
3636 tests passing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ikx94 added a commit to ikx94/desloppify that referenced this pull request Mar 2, 2026
…fixes

WIP — coded with Claude Code.

New:
- languages/php/test_coverage.py — full test coverage hooks
  (PHPUnit/Pest assertions, use-statement parsing incl group use,
  has_testable_logic, is_runtime_entrypoint, map_test_to_source)
- languages/php/review_data/dimensions.override.json

Fixes across 10 files addressing ~20 PHP gaps:
- SECRET_NAME_RE: match $variable assignments (peteromallet#14)
- ENV_LOOKUPS: add env(), getenv(), $_ENV[], config() (peteromallet#11)
- LOG_CALLS: add Log::info/error/etc, error_log() (peteromallet#13)
- RANDOM_CALLS: add rand(), mt_rand() (peteromallet#12)
- Import query: group use App\Models\{User, Post} (peteromallet#5)
- resolve_php_import: actually read composer.json PSR-4 (peteromallet#4)
- Unused imports: handle aliased use Foo as Bar (peteromallet#6)
- class_query: add enum_declaration (peteromallet#8)
- _CLOSURE_NODE_TYPES: add anonymous_function_creation_expression (peteromallet#9)
- _BRANCHING_NODE_TYPES: add match_conditional_expression (peteromallet#10)
- Signature _ALLOWLIST: __construct, boot, register, render, etc (peteromallet#22)
- _infer_lang_name: add .php -> php (peteromallet#2)
- generic_lang: entry_patterns parameter (peteromallet#3)
- PHP __init__: wire test_coverage, entry_patterns, zone_rules,
  exclude storage/bootstrap/cache/IDE helpers (peteromallet#1,peteromallet#16,peteromallet#19,peteromallet#20,peteromallet#24)
- Remediation text: add random_bytes() for PHP (peteromallet#15)

Deferred: peteromallet#17 (barrel_names — N/A), peteromallet#18 (dynamic_import_finder)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

Windows scan issues: unsupported auto-detect and Unix grep/find dependency

1 participant