-
-
Notifications
You must be signed in to change notification settings - Fork 234
feat: add glob pattern support to file-conversion-map for Nix paths #2041
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Add wildcard pattern matching (* and **) to *file-conversion-map* for flexible path conversion, particularly useful for Nix store paths. - Add glob-pattern-to-regex for converting glob patterns to regex - Add expand-path for proper ~/, ./, and absolute path handling - Add resolve-glob-directory for resolving wildcard patterns - Mark /nix/store/ paths as read-only in read-only-sources - Maintain backward compatibility with existing prefix-match patterns
|
❌ Code Contractor Validation: FAILED 📚 About Code ContractorDeclarative Code Standards That Learn and Improve Define domain-specific validation rules in YAML. Want this for your repo? |
Add comprehensive tests for: - has-glob-wildcard-p detection - glob-pattern-to-regex conversion - match-glob-pattern matching - expand-path for ~/, ./, and absolute paths - convert-remote-to-local-file with backward compatibility - convert-local-to-remote-file reverse conversion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Contractor: functional_style_rule
AI check failed: "functional_style_rule"
Reason:
The diff relies on the special global *file-conversion-map* (defined with defvar) as shared state between functions like convert-remote-to-local-file/convert-local-to-remote-file, instead of passing the map explicitly via function arguments.
- Request fix suggestion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Contractor: macro_style_rule
AI check failed: "macro_style_rule"
Reason:
Uses backquote (...) outside of a macro; validation rule requires preferring list over backquote outside macros.
- Request fix suggestion
Default mapping: /nix/store/*-source-patched/ -> ./ This enables automatic source location conversion for Nix-built Lem without requiring user configuration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Contractor: docstring_rule
AI check failed: "docstring_rule"
Reason:
The docstrings added to important functions convert-remote-to-local-file and convert-local-to-remote-file describe what they do but do not explain why the conversion is needed, violating the rule that important functions should explain "why", not just "what".
- Request fix suggestion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Contractor: macro_style_rule
AI check failed: "macro_style_rule"
Reason:
Uses backquote outside of a macro (e.g., (... ,(namestring test-dir) ...)), violating the rule to prefer list over backquote outside macros.
- Request fix suggestion
- Add 'why' explanations to docstrings for convert-remote-to-local-file and convert-local-to-remote-file (docstring_rule) - Replace backquote with list/cons in test file (macro_style_rule)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Contractor: functional_style_rule
AI check failed: "functional_style_rule"
Reason:
The diff continues to use a global special variable via defvar (*file-conversion-map*) as shared state between functions, and adds additional behavior/tests that rely on dynamically binding it instead of passing the map explicitly as a function argument.
- Request fix suggestion
This adds glob pattern matching to
*file-conversion-map*for flexible path conversion, particularly useful for Nix store paths where hash prefixes vary.Changes
*for single segment,**for recursive)expand-pathfunction for proper~/,./, and absolute path handlingresolve-glob-directoryfor resolving wildcard patterns to actual directories/nix/store/paths as read-only inread-only-sources.lispUsage
Test plan
*matches single path segment)~/,./, and absolute paths correctly