Fix uv cooldown rule with brackets in TOML sections - #4011
Conversation
Signed-off-by: Eljees <yurytumanov.r@yandex.ru>
|
@Eljees please sign the CLA and then we can merge. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f4e1efb61f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Was looking at #3993 myself and ran into your PR. The line-anchored boundary is the right call. Two things I hit while testing that I think are still open here: 1. A commented-out/mentioned [tool.uv]
override-dependencies = ["urllib3<2"]
# TODO: set exclude-newer once we finalize the cooldown policyNo cooldown is set here, but the rule stays quiet. Anchoring to an actual assignment fixes it, e.g. 2. [tool.uv]
constraint-dependencies = [
["nested"],
]
exclude-newer = "7 days"This is a valid config but gets flagged. Using Might be worth a couple of test cases for both. Happy to send a patch if useful. |
|
Thanks for catching both cases. I addressed them in 405ce5b:
I also added regression cases for both examples. The Semgrep scan and CLA checks are green. |
|
@LewisArdern the CLA is signed now (the check flipped green a while ago), and mmassime's two edge cases are addressed in 405ce5b with regression tests for both. Should be good to merge whenever you get a chance. |
|
@mmassime both of those were real, and both are fixed in 405ce5b.
Both of your snippets are in @LewisArdern the CLA is signed and both checks are green, so this is ready whenever you are. |
|
@LewisArdern this has been approved and green since the CLA went through, and @mmassime's two edge cases are fixed in 405ce5b with regression tests. Anything else needed before merge? |
|
@LewisArdern this one is still open. It has been approved since 20 July, the CLA check is green, and the Semgrep scan passes on This is my third nudge, so it is the last one. If something is still blocking the merge, tell me what it is and I will fix it. If the rule is not wanted in this shape, closing it is a fine outcome - I would rather that than leave it sitting open. |
|
Following up on my note from 8 August, since nobody named a blocker. As far as I can tell there is nothing outstanding on my side: approved by @LewisArdern on 20 July, CLA signed, both checks passing on If the rule is not wanted in this shape, I would rather close it than leave it sitting open — just say the word. |
Summary
[inside[tool.uv]as the beginning of a new TOML tableRoot cause
The section matcher used
[^\[]*, so ordinary TOML values and comments containing square brackets truncated$TARGET. As a result, a validexclude-newerlater in the same section was invisible to the rule.Validation
semgrep test package_managers/uv(1/1: All tests passed)semgrep validate package_managers/uv/uv-missing-dependency-cooldown.yamlmetadata-cwe-prohibited-or-discouragedlint on the changed rule (0 findings)Fixes #3993.