fix: cross-platform support — remove grep/find dependency (#7)#8
Merged
peteromallet merged 1 commit intomainfrom Feb 12, 2026
Merged
fix: cross-platform support — remove grep/find dependency (#7)#8peteromallet merged 1 commit intomainfrom
peteromallet merged 1 commit intomainfrom
Conversation
…(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
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>
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
grep/findsubprocess calls with pure-Python equivalents (os.walk,remodule), eliminating the dependency on GNU tools — fixes the WindowsFileNotFoundErrorcrashauto_detect_lang()to only return languages with registered plugins (preventsValueError: Unknown language: 'go'whengo.modpresent)DEFAULT_EXCLUSIONSthat 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 treesWhat changed
utils.pyfindsubprocess withos.walk; addgrep_files(),grep_files_containing(),grep_count_files()pure-Python utilities; addDEFAULT_EXCLUSIONSlang/__init__.pyauto_detect_lang()now checks_registrybefore returning a languagelang/typescript/detectors/logs.pygrep_files()instead of subprocess greplang/typescript/detectors/exports.pygrep_files()+grep_files_containing()instead of subprocess grep + temp pattern fileslang/typescript/detectors/deprecated.pygrep_files()+grep_count_files()instead of subprocess greplang/typescript/detectors/deps.pygrep_files()+find_ts_files()instead ofrun_grep(["grep", ...])lang/python/detectors/deps.pygrep_files()+find_py_files()instead ofrun_grep(["grep", ...])visualize.pyfind_ts_files()instead of subprocess findTest plan
--excludeflag still works correctlyauto_detect_langreturnsNonefor go-only dirs,pythonfor go+python dirsCloses #7
🤖 Generated with Claude Code