Skip to content

LCORE-1374: Contributing guide#1224

Merged
tisnik merged 1 commit intolightspeed-core:mainfrom
tisnik:lcore-1374-contributing-guide
Feb 25, 2026
Merged

LCORE-1374: Contributing guide#1224
tisnik merged 1 commit intolightspeed-core:mainfrom
tisnik:lcore-1374-contributing-guide

Conversation

@tisnik
Copy link
Contributor

@tisnik tisnik commented Feb 25, 2026

Description

LCORE-1374: Contributing guide

Type of change

  • Refactor
  • New feature
  • Bug fix
  • CVE fix
  • Optimization
  • Documentation Update
  • Configuration Update
  • Bump-up service version
  • Bump-up dependent library
  • Bump-up library or tool used for development (does not change the final image)
  • CI configuration change
  • Konflux configuration change
  • Unit tests improvement
  • Integration tests improvement
  • End to end tests improvement
  • Benchmarks improvement

Tools used to create PR

  • Assisted-by: N/A
  • Generated by: N/A

Related Tickets & Documents

  • Related Issue #LCORE-1374

Summary by CodeRabbit

  • Documentation
    • Added Function Standards section to contribution guidelines, including standards for documentation, type annotations, naming conventions, async functions, and error handling.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 25, 2026

Walkthrough

A new "Function Standards" section is added to two documentation files (CONTRIBUTING.md and docs/contributing_guide.md) under Code style, introducing guidelines for documentation, type annotations, naming conventions, async functions, and error handling.

Changes

Cohort / File(s) Summary
Function Standards Documentation
CONTRIBUTING.md, docs/contributing_guide.md
Added "Function Standards" section under Code style with subsections for documentation, type annotations, naming conventions, async functions, and error handling. Table of Contents updated to reflect new section structure.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'LCORE-1374: Contributing guide' is vague and overly broad, using generic terms that don't convey meaningful detail about the specific changes made to the documentation. Replace with a more specific title that describes the actual changes, such as 'Add Function Standards guidelines to CONTRIBUTING.md and docs/contributing_guide.md' or 'Add function documentation and type annotation standards to contributing guides'.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

♻️ Duplicate comments (1)
CONTRIBUTING.md (1)

246-261: Same content issues as docs/contributing_guide.md.

The Optional[Type] / modern-syntax inconsistency, the missing cross-reference to "Docstrings style", and the missing terminal periods flagged in docs/contributing_guide.md apply equally here.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@CONTRIBUTING.md` around lines 246 - 261, The CONTRIBUTING.md fragment repeats
the same issues as docs/contributing_guide.md: inconsistent type syntax (mix of
modern union syntax `str | int` and legacy `Optional[Type]`), missing
cross-reference to the "Docstrings style" section, and several list items
lacking terminal periods; update the text to consistently use one typing style
(prefer modern `X | Y` or explicitly state policy and convert `Optional[Type]`
to `Type | None` if choosing modern syntax), add a cross-reference/link to the
"Docstrings style" section, and ensure all bullet/list entries (e.g., "Use
`typing_extensions.Self` for model validators", "Union types: `str | int`",
"Optional: `Optional[Type]`", "Use snake_case...", "Use `async def`...", "Use
FastAPI `HTTPException`...") end with terminal periods for consistency.
🧹 Nitpick comments (2)
CONTRIBUTING.md (1)

236-262: Duplicate content will drift — consider a single source of truth.

The entire "Function Standards" block (lines 236–262) is identical to the one in docs/contributing_guide.md. Keeping two copies in sync manually is error-prone. A common approach is to keep the canonical content in one file and replace the other with a brief summary and a link.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@CONTRIBUTING.md` around lines 236 - 262, Remove the duplicated "### Function
Standards" section from CONTRIBUTING.md and replace it with a short
one-paragraph summary that points to the canonical version in
docs/contributing_guide.md (e.g., "See the full Function Standards in
docs/contributing_guide.md") so the single source of truth is the file
docs/contributing_guide.md; ensure the replacement references the "### Function
Standards" heading and retains any necessary linking text but does not
re-duplicate the full block.
docs/contributing_guide.md (1)

238-240: Add a cross-reference to the existing "Docstrings style" section.

The "Documentation" subsection is intentionally terse, but it should point readers to the detailed "Docstrings style" section below (which covers Args, Returns, Raises, and a full example). Without the link, contributors may not discover the fuller guidance.

✏️ Suggested update
 #### Documentation

-All functions require docstrings with brief descriptions
+All functions require docstrings with brief descriptions. See the
+[Docstrings style](`#docstrings-style`) section for format and examples.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/contributing_guide.md` around lines 238 - 240, Update the terse
"Documentation" subsection to include a cross-reference/link to the detailed
"Docstrings style" section: modify the paragraph that reads "All functions
require docstrings with brief descriptions" so it ends with a pointer such as
"See the 'Docstrings style' section below for required Args, Returns, Raises and
examples." Ensure the visible section title string "Docstrings style" is used
verbatim so readers can easily find the full guidance.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/contributing_guide.md`:
- Around line 246-248: The docs currently mix modern PEP 604 union syntax (`str
| int`) with the legacy `Optional[Type]`; update the guidance to use modern
optional unions everywhere by replacing the `Optional[Type]` recommendation with
`Type | None` and note that `typing_extensions.Self` guidance remains unchanged;
ensure the examples and bullet list consistently prefer the `X | Y` form for
both unions and optionals.
- Around line 240-261: Add missing terminal periods to the prose sentences in
the new section: add a period at the end of the lines for "All functions require
docstrings with brief descriptions", the "Type annotations" introductory line,
the "Use snake_case with descriptive, action-oriented names (get_, validate_,
check_)" line, and the "Use async def for I/O operations and external API calls"
line so that they end with full stops; locate these within the section that
contains the headings "All functions require docstrings with brief
descriptions", "#### Type annotations", "#### Naming conventions", and "####
Async functions" and update the sentences to include a trailing period for
consistency with surrounding documentation style.

---

Duplicate comments:
In `@CONTRIBUTING.md`:
- Around line 246-261: The CONTRIBUTING.md fragment repeats the same issues as
docs/contributing_guide.md: inconsistent type syntax (mix of modern union syntax
`str | int` and legacy `Optional[Type]`), missing cross-reference to the
"Docstrings style" section, and several list items lacking terminal periods;
update the text to consistently use one typing style (prefer modern `X | Y` or
explicitly state policy and convert `Optional[Type]` to `Type | None` if
choosing modern syntax), add a cross-reference/link to the "Docstrings style"
section, and ensure all bullet/list entries (e.g., "Use `typing_extensions.Self`
for model validators", "Union types: `str | int`", "Optional: `Optional[Type]`",
"Use snake_case...", "Use `async def`...", "Use FastAPI `HTTPException`...") end
with terminal periods for consistency.

---

Nitpick comments:
In `@CONTRIBUTING.md`:
- Around line 236-262: Remove the duplicated "### Function Standards" section
from CONTRIBUTING.md and replace it with a short one-paragraph summary that
points to the canonical version in docs/contributing_guide.md (e.g., "See the
full Function Standards in docs/contributing_guide.md") so the single source of
truth is the file docs/contributing_guide.md; ensure the replacement references
the "### Function Standards" heading and retains any necessary linking text but
does not re-duplicate the full block.

In `@docs/contributing_guide.md`:
- Around line 238-240: Update the terse "Documentation" subsection to include a
cross-reference/link to the detailed "Docstrings style" section: modify the
paragraph that reads "All functions require docstrings with brief descriptions"
so it ends with a pointer such as "See the 'Docstrings style' section below for
required Args, Returns, Raises and examples." Ensure the visible section title
string "Docstrings style" is used verbatim so readers can easily find the full
guidance.

ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 71b93ea and 2d8c484.

📒 Files selected for processing (2)
  • CONTRIBUTING.md
  • docs/contributing_guide.md

Comment on lines +240 to +261
All functions require docstrings with brief descriptions

#### Type annotations

Use complete type annotations for parameters and return types

- Use `typing_extensions.Self` for model validators
- Union types: `str | int` (modern syntax)
- Optional: `Optional[Type]`

#### Naming conventions

Use snake_case with descriptive, action-oriented names (get_, validate_, check_)

#### Async functions

Use `async def` for I/O operations and external API calls

#### Error handling

- Use FastAPI `HTTPException` with appropriate status codes for API endpoints
- Handle `APIConnectionError` from Llama Stack where appropriate
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Prose lines in the new section are missing terminal periods.

Lines 240, 244, 252, and 256 each end a sentence without a full stop. This is inconsistent with the surrounding documentation style.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/contributing_guide.md` around lines 240 - 261, Add missing terminal
periods to the prose sentences in the new section: add a period at the end of
the lines for "All functions require docstrings with brief descriptions", the
"Type annotations" introductory line, the "Use snake_case with descriptive,
action-oriented names (get_, validate_, check_)" line, and the "Use async def
for I/O operations and external API calls" line so that they end with full
stops; locate these within the section that contains the headings "All functions
require docstrings with brief descriptions", "#### Type annotations", "####
Naming conventions", and "#### Async functions" and update the sentences to
include a trailing period for consistency with surrounding documentation style.

Comment on lines +246 to +248
- Use `typing_extensions.Self` for model validators
- Union types: `str | int` (modern syntax)
- Optional: `Optional[Type]`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Optional[Type] contradicts the adjacent modern-syntax recommendation.

The guide promotes PEP 604 str | int syntax (modern) on line 247, but then prescribes the legacy Optional[Type] form on line 248. Since the project requires Python 3.12+, both union and optional should use the modern union syntax (Type | None) for consistency.

✏️ Suggested update
 - Use `typing_extensions.Self` for model validators
-- Union types: `str | int` (modern syntax)
-- Optional: `Optional[Type]`
+- Union types: use `str | int` (PEP 604 modern syntax)
+- Optional values: use `Type | None` instead of `Optional[Type]`
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- Use `typing_extensions.Self` for model validators
- Union types: `str | int` (modern syntax)
- Optional: `Optional[Type]`
- Use `typing_extensions.Self` for model validators
- Union types: use `str | int` (PEP 604 modern syntax)
- Optional values: use `Type | None` instead of `Optional[Type]`
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/contributing_guide.md` around lines 246 - 248, The docs currently mix
modern PEP 604 union syntax (`str | int`) with the legacy `Optional[Type]`;
update the guidance to use modern optional unions everywhere by replacing the
`Optional[Type]` recommendation with `Type | None` and note that
`typing_extensions.Self` guidance remains unchanged; ensure the examples and
bullet list consistently prefer the `X | Y` form for both unions and optionals.

@tisnik tisnik merged commit 316341a into lightspeed-core:main Feb 25, 2026
21 of 22 checks passed
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