Repository navigation
Conversation
|
This pull request has been imported. If you are a Meta employee, you can view this in D115572089. (Because this pull request was imported automatically, there will not be any future comments.) |
|
This pull request has been automatically marked as stale because it has not had recent activity for more than 2 weeks. If you are still working on this this pull request, please add a comment or push new commits to keep it active. Otherwise, please unassign yourself and allow someone else to take over. Thank you for your contributions! |
|
Still working on this; keeping it active for review. |
stroxler
left a comment
There was a problem hiding this comment.
Hi @cakeni - sorry for the slow turnaround on this.
Unfortunately, this PR is tied to a stale diff internally, which makes it hard for me to review and merge it. Would you mind closing this PR and opening a fresh one? Then you can assign it to me - I should be able to turn around review much faster.
While you're at it, could you make a couple of minor adjustments? An initial AI review flagged two potential issues:
-
The JSON schema rejects the new list syntax.
[schemas/pyrefly.json:376–378](https://github.com/meta/pyrefly/blob/9beaefd178062f7e7341a761c6c26b7264caae43/schemas/pyrefly.json#L376-L378)still requires"type": "string". I confirmed the documentedmatches = ["src/first.py", "tests/second.py"]example fails validation for bothpyrefly.tomlandpyproject.toml.
Fix: accept a string or an array of strings withminItems: 1, and add positive-list and empty-list schema tests. -
Invalid-glob diagnostics regress, including for existing scalar configs.
[config.rs:135–142](https://github.com/meta/pyrefly/blob/9beaefd178062f7e7341a761c6c26b7264caae43/crates/pyrefly_config/src/config.rs#L135-L142)uses an untagged enum that discards the underlyingGloberror. Formatches = "src/[a", the useful message identifying the malformed pattern becomesdata did not match any variant of untagged enum OneOrMany. A bad list entry produces the same generic error.
Fix: use a string-or-sequence serde visitor that propagates glob errors directly, with regression tests for malformed scalar and list entries.
|
Once again just to make sure it doesn't get lost: to help me turn this around, could you not only address those concerns, but close this PR and open a fresh one, assigned to me? |
Summary
Allow
[[sub-config]]'smatcheskey to accept either a single glob string or a non-empty list of glob strings. A listed sub-config applies when any entry matches, while existing single-string configurations retain their current behavior and precedence.The change also updates migration code and configuration documentation, and adds coverage for single values, multiple values, and rejection of an empty list.
Fixes #4462
Test Plan
python test.py --no-test --no-tensor-shapes --no-conformance --no-jsonschema(formatting passed; local lint compilation is blocked by the installed MinGW headers while buildingmimalloc)