Skip to content

agents(rules): add Starlark dict union and Pyrefly PackagePath conventions - #4038

Draft
rickeylev wants to merge 1 commit into
bazel-contrib:mainfrom
rickeylev:agent_rules_starlark_python
Draft

agents(rules): add Starlark dict union and Pyrefly PackagePath conventions#4038
rickeylev wants to merge 1 commit into
bazel-contrib:mainfrom
rickeylev:agent_rules_starlark_python

Conversation

@rickeylev

Copy link
Copy Markdown
Collaborator

Starlark supports the dictionary union operator (|), making skylib's
dicts.add redundant. When using importlib.metadata in Python,
f.locate() is typed as PathLike and lacks filesystem methods like
.exists() and .is_file() under Pyrefly unless wrapped with
pathlib.Path.

Add rules instructing agents to prefer the dict union operator (|)
over dicts.add in Starlark and to wrap f.locate() calls with
pathlib.Path() in Python type-annotated code.

…tions

Starlark supports the dictionary union operator (|), making skylib's
dicts.add redundant. When using importlib.metadata in Python,
f.locate() is typed as PathLike and lacks filesystem methods like
.exists() and .is_file() under Pyrefly unless wrapped with
pathlib.Path.

Add rules instructing agents to prefer the dict union operator (|)
over dicts.add in Starlark and to wrap f.locate() calls with
pathlib.Path() in Python type-annotated code.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant