Skip to content

Commit 85bb1d8

Browse files
Update llm.md
1 parent f3b993f commit 85bb1d8

File tree

1 file changed

+11
-6
lines changed
  • recipes/artificial-intelligence

1 file changed

+11
-6
lines changed

recipes/artificial-intelligence/llm.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,26 +20,26 @@ Always add docstrings.
2020
2121
For Bash, keep docstrings to one line.
2222
23-
For Python, prefer list comprehensions and dict comprehensions, but use `for` loops if that makes the code more readable.
24-
25-
For Python, write Python docstrings using Google style format e.g.
23+
For Python, prefer list comprehensionsi and dict comprehensions, but use `for` loops if that makes the code more readable.
24+
For Python, remember to add imports when using new objects or types and put imports at the top of the file.
25+
For Python, write Python docstrings using Google style format including `:param name:` style and ending with a fullstop and empty between `:param:` and `:returns:` as below e.g.
2626
"""
2727
Return the sum of abc and def.
2828
2929
:param abc: Description.
3030
:param def: Description.
3131
32-
:return xyz: Description.
32+
:returns xyz: Description.
3333
"""
3434
3535
For Python, write one-line docstrings on 3 lines. e.g.
3636
"""
37-
Description
37+
Return the sum of abc and def.
3838
"""
3939
4040
For Python, prefer f-string formatting over other string formatting methods.
4141
42-
For Python and JS, always use type annotations for function parameters and return types. Create custom types for complex structures, especially for lists and dicts.
42+
For Python and JS, always use type annotations for function parameters and return types. Create custom types for complex structures, especially for lists and dicts. Use the most modern types available for Python e.g. favor `list` over `List`.
4343
4444
For JS, prefer functional React components with hooks over class components.
4545
For JS, use async-await syntax.
@@ -60,4 +60,9 @@ For Markdown:
6060
Create lists using a dash instead of an asterisk.
6161
Style bold text as `**bold**`.
6262
Style italic text as `_italics_`.
63+
64+
Indentation
65+
4 spaces for Python, Markdown, HTML, CSS.
66+
2 spaces for JS, JSX, and Bash.
67+
Use tabs for Makefile.
6368
```

0 commit comments

Comments
 (0)