Repository navigation
Commit 23684f6
authored
agents(rules): add Starlark dict union and Pyrefly PackagePath conventions (bazel-contrib#4038)
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.1 parent 9361a1a commit 23684f6
2 files changed
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
| 45 | + | |
44 | 46 | | |
45 | 47 | | |
46 | 48 | | |
| |||
0 commit comments