Skip to content

[docs] Add that type hinting is unnecessary for test cases#3496

Open
tepals wants to merge 1 commit into
delmic:masterfrom
tepals:docs-update-guidelines-type-hint-test
Open

[docs] Add that type hinting is unnecessary for test cases#3496
tepals wants to merge 1 commit into
delmic:masterfrom
tepals:docs-update-guidelines-type-hint-test

Conversation

@tepals

@tepals tepals commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Updates the developer coding guidelines documentation to clarify that type hints are not required for test methods, aligning expectations for writing tests in this codebase.

Changes:

  • Adds a note stating type hinting is unnecessary for test functions/methods.
  • Extends the “Docstrings” guidance for test methods.

Comment on lines 162 to 166
In test classes, it is recommended to have one-line docstring for each test method. For very short and obvious
tests, where the function name explain what all it does, then in such cases, the docstring can be omitted.
tests, where the function name explain what all it does, then in such cases, the docstring can be omitted. As test
functions only have self as input argument and no return value, type hinting in the function signature is not required.

For e.g. 2.3 the test class should be defined as
@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The coding guidelines documentation (doc/develop/coding-guidelines.rst) is updated at lines 163–164. The existing rule allowing docstrings to be omitted for very short and self-explanatory test methods is extended to also explicitly state that type hints in the function signature are not required for such tests.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive No description was provided by the author, making it impossible to assess whether it relates to the changeset. Add a brief pull request description explaining the purpose and context of the coding guidelines update.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main change in the pull request, which updates coding guidelines to clarify that type hinting is unnecessary for test cases.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
doc/develop/coding-guidelines.rst (1)

163-164: 💤 Low value

Improve grammar in line 163.

The phrase "explain what all it does" is slightly awkward; it should read "explain what it does" for standard English.

✏️ Proposed fix
- tests, where the function name explain what all it does, then in such cases, the docstring can be omitted. As test
+ tests, where the function name explains what it does, then in such cases, the docstring can be omitted. As test
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@doc/develop/coding-guidelines.rst` around lines 163 - 164, In the
documentation about test function naming conventions, correct the grammatical
error in the phrase that currently reads "explain what all it does". Change this
phrase to "explain what it does" to follow standard English grammar. This
appears in the context of describing when docstrings can be omitted for test
functions with self as the only input argument.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@doc/develop/coding-guidelines.rst`:
- Around line 163-164: In the documentation about test function naming
conventions, correct the grammatical error in the phrase that currently reads
"explain what all it does". Change this phrase to "explain what it does" to
follow standard English grammar. This appears in the context of describing when
docstrings can be omitted for test functions with self as the only input
argument.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e9d7f04c-ef49-4130-8262-9f3fa3707e4d

📥 Commits

Reviewing files that changed from the base of the PR and between cc0d220 and cf3f2b5.

📒 Files selected for processing (1)
  • doc/develop/coding-guidelines.rst

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants