You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 8b06c55
Browse filesBrowse the repository at this point in the historyBrowse files
docs: update the contributing guide and agent rules (#2415)
Small cleanup of `CONTRIBUTING.md` and `.rules.md`:
- Add a YAML quoting rule: leave values unquoted unless quotes are
needed, then use double quotes. The SDK and client guides get the same
rule.
- Note in `.rules.md` how models are configured: `validate_by_name=True,
validate_by_alias=True` plus an explicit `Field(alias=...)` for each
camelCase field.
- Unwrap the two hard-wrapped paragraphs in "Linting the docs and
website" so they match the rest of the file.
*✍️ Drafted by Claude Code*
Copy file name to clipboardExpand all lines: .rules.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,8 @@ Read [CONTRIBUTING.md](CONTRIBUTING.md) first. It covers setup, tasks, tests, co
12
12
13
13
Don't introduce a shared Pydantic base model to centralize `model_config`. Each model inherits `pydantic.BaseModel` and declares `model_config = ConfigDict(...)` inline, which also keeps ruff's flake8-type-checking and `RUF012` checks working, since they only recognize a literal `pydantic.BaseModel` base.
14
14
15
+
Models set `validate_by_name=True, validate_by_alias=True` in their `ConfigDict` and give each camelCase wire name an explicit `Field(alias=...)`.
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+6-7Lines changed: 6 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -81,6 +81,10 @@ uv run poe e2e-templates-tests
81
81
- On Windows with Python 3.12 or older, `datetime.now()` ticks in 1-15 ms steps, so two timestamps taken a few milliseconds apart can be equal. A test that asserts one timestamp is later than another injects a `Mock` clock instead of sleeping.
82
82
- For a TCP endpoint that must refuse connections, bind a socket to `('127.0.0.1', 0)` and hold it open without calling `listen()`. A hard-coded port can be taken by a server in a parallel xdist worker. Test servers use `127.0.0.1`, since on Windows `localhost` resolves to both IPv4 and IPv6.
83
83
84
+
### YAML
85
+
86
+
Leave YAML values unquoted unless quotes are needed: a plain value that would change type (`"3.14"`, `"true"`, `""`), start with an indicator character (`"*"`, `"@apify/*"`), contain a colon followed by a space or a `#` preceded by one (`"a: b"`, `"a #b"`), or need an escape sequence (`"\n"`). Use double quotes then. Keep single quotes when the value itself contains double quotes, and for string literals inside GitHub Actions expressions (`${{ ... }}`, `if:` conditions), where double quotes are invalid.
87
+
84
88
## Documentation
85
89
86
90
We follow the [Google docstring format](https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html) for code documentation. All user-facing classes and functions must be documented. Documentation standards are enforced using [Ruff](https://docs.astral.sh/ruff/).
@@ -97,20 +101,15 @@ uv run poe run-docs
97
101
98
102
### Linting the docs and website
99
103
100
-
Markdown content (this guide, `README.md`, and the `docs/` folder) is checked with
101
-
[markdownlint](https://github.com/DavidAnson/markdownlint). The Docusaurus website code is linted
102
-
with [oxlint](https://oxc.rs/) in type-aware mode (types come from `website/tsconfig.json`) and
103
-
formatted with [oxfmt](https://oxc.rs/). All of them run in CI.
104
-
To run them locally (requires Node.js 22.12 or newer and pnpm), from the `website/` directory:
104
+
Markdown content (this guide, `README.md`, and the `docs/` folder) is checked with [markdownlint](https://github.com/DavidAnson/markdownlint). The Docusaurus website code is linted with [oxlint](https://oxc.rs/) in type-aware mode (types come from `website/tsconfig.json`) and formatted with [oxfmt](https://oxc.rs/). All of them run in CI. To run them locally (requires Node.js 22.12 or newer and pnpm), from the `website/` directory:
105
105
106
106
```sh
107
107
pnpm lint # lint Markdown and website code
108
108
pnpm lint:fix # auto-fix both
109
109
pnpm format # format the website code
110
110
```
111
111
112
-
Doc images are committed as optimized `.webp`. To convert a new image, run
113
-
`pnpm opt:images <path-to-image>` from the `website/` directory.
112
+
Doc images are committed as optimized `.webp`. To convert a new image, run `pnpm opt:images <path-to-image>` from the `website/` directory.
0 commit comments