Repository navigation
fix(config): validate 're:' match patterns and report exact paths (closes #118) - #159
Conversation
|
Thanks @txltedxgod — this fixes #118 cleanly at all three layers (schema, diagnostics, matcher). Verified locally at
Non-blocking notes:
Nice touch adding the matcher defense-in-depth: a pattern that somehow slips through now degrades to "never matches" instead of crashing, and that behavior is pinned by the tests. Verdict: no blocking issues — ready to merge from my side. Automated PR evaluation — verified locally in a throwaway worktree (pytest, ruff, pylint, pyright); comment-only review. |
|
Merged — thank you @txltedxgod! 🎉 Clean, well-scoped fix for #118: validating at the schema layer, surfacing exact editor paths ( Welcome to the project as a contributor, and glad to have you back — if you spot another issue you'd like to pick up, the |
Closes #118.
Problem
Previously, specifying an invalid regex pattern (e.g.
re:([unclosed) undermatch.hostname,match.ip, ormatch.pathwas not validated during configuration parsing or schema validation. When ProFiles attempted to match criteria,re.search()raised an unhandledre.errorcausing a crash at startup or during configuration inspection. Furthermore, diagnostics/validation incollect_issues()did not validatere:syntax to surface inline editor problems.Solution
re:-prefixed pattern compiles withre.compile(pattern[3:])or raises a validation error.collect_issues()and reports exact issue paths (e.g.configs.<name>.match.<field>[<idx>]orconfigs.<name>.match.<field>) with severityerrorso the web editor problems list highlights the malformed regex line.