Skip to content

docs: say that none meaning skip is a condition inside the function - #9643

Merged
koenvanderveen merged 1 commit into
devfrom
koen/guideline-optional-return-condition
Nov 19, 2026
Merged

koenvanderveen merged 1 commit into
devfrom
koen/guideline-optional-return-condition

Conversation

@koenvanderveen

Copy link
Copy Markdown
Collaborator

Summary

  • When a PR description or the syft-pr-review skill rates a PR against "Keep the condition for doing something in the caller", it previously missed a function that returns a value or None, where None means "skip this". For example, PR feat: say when a log shows only its first characters #9631 first had _log_note() return a note or None, and its PR description rated function structure 🟢. Now the guideline names this case, with an example: ask the question with a separate function, such as log_is_truncated(), and keep the if in the caller.

Guidelines

High level

  • 🟢 Split: no need to split.
  • 🟢 Size: add the "None means skip" case to the guideline on keeping conditions in the caller.

Mid level

  • 🟢 User-facing code
  • 🟢 Error handling
  • 🟢 State versioning
  • 🟢 Function structure
  • 🟢 Tests

Low level

  • 🟢 Naming
  • 🟢 Code style

Security

No change.

Testing

  • Docs only. pre-commit run --all-files passes.

Asana task

PR #9631 had _log_note() return a note or None, where None meant
'add nothing'. Its PR description rated function structure green,
because the guideline read as being about functions that do something.
Add this case and an example to the guideline.
@koenvanderveen
koenvanderveen merged commit 3921fca into dev Nov 19, 2026
21 checks passed
@koenvanderveen
koenvanderveen deleted the koen/guideline-optional-return-condition branch November 19, 2026 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant