-
-
Notifications
You must be signed in to change notification settings - Fork 625
#1872 fix: drop the legacy dot and repair dangling metafile paths #1881
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,6 +19,17 @@ | |
| DOTS_DIR = REPO_ROOT / "Scripts" / "dots" | ||
|
|
||
|
|
||
| def declared_paths(table: dict) -> list: | ||
| """`paths` is a single string or a list of them.""" | ||
| paths = table.get("paths", []) | ||
| return [paths] if isinstance(paths, str) else list(paths) | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
|
|
||
|
|
||
| def has_glob(relative: str) -> bool: | ||
| """A pattern is resolved at deploy time, so it cannot be checked here.""" | ||
| return any(character in relative for character in "*?[") | ||
|
|
||
|
|
||
| def inside_repo(relative: str) -> bool: | ||
| """A source path has to stay in the checkout, absolute or `..` included.""" | ||
| root = REPO_ROOT.resolve() | ||
|
|
@@ -89,6 +100,12 @@ def fail(message: str) -> None: | |
| fail(f"{where} points outside the repository with source_root {source_root!r}") | ||
| elif not (REPO_ROOT / source_root).is_dir(): | ||
| fail(f"{where} points at a missing source_root {source_root!r}") | ||
| else: | ||
| for relative in declared_paths(table): | ||
| if not isinstance(relative, str): | ||
| fail(f"{where} declares a path as {type(relative).__name__}, expected a string") | ||
| elif not has_glob(relative) and not (REPO_ROOT / source_root / relative).exists(): | ||
| fail(f"{where} points at a missing path {relative!r}") | ||
|
Comment on lines
+104
to
+108
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win Constrain declared paths to Only 🤖 Prompt for AI Agents
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed. Each declared path is resolved against the resolved source root and has to stay under it, checked before the glob exemption.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
echo '--- Current relevant implementation ---'
sed -n '15,125p' tests/python/check_dots.py
echo
echo '--- Working-tree diff for the validation file ---'
git diff -- tests/python/check_dots.pyLength of output: 4583
Please push or update the commit containing the change, then retry so I can confirm and mark this resolved. This chat is LLM-generated and may be inaccurate. |
||
|
|
||
| for component, table in dependencies(document): | ||
| where = f"{name} [{component}.dependency]" | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.