From 7e48c6904dfe856ba9b990697615d855ef2139cd Mon Sep 17 00:00:00 2001 From: jnasbyupgrade Date: Tue, 3 Nov 2026 11:29:37 -0600 Subject: [PATCH 1/2] CODE_STYLE.md: validate arguments and preconditions before acting Caller sanity checks belong before any meaningful action, unless there is a good reason to wait. Prompted by review feedback on https://github.com/Postgres-Extensions/object_reference/pull/45 --- CODE_STYLE.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CODE_STYLE.md b/CODE_STYLE.md index a547bcb..977aac9 100644 --- a/CODE_STYLE.md +++ b/CODE_STYLE.md @@ -67,6 +67,12 @@ protection it exists to provide, not simplifying dead weight (see [Postgres-Extensions/test_factory#18](https://github.com/Postgres-Extensions/test_factory/pull/18), where this was done and then reverted). +## Validate before acting + +Check a function's caller-supplied arguments and its preconditions +before taking any meaningful action — before any side effect — unless +there is a good reason to wait. + ## Closing non-indentable blocks When closing a code block that cannot be indented to show its nesting From 0cf1e4cfc09cb65c7caf0ec341af7dfa8d31a38a Mon Sep 17 00:00:00 2001 From: jnasbyupgrade Date: Tue, 3 Nov 2026 11:33:51 -0600 Subject: [PATCH 2/2] CODE_STYLE.md: narrow validate-before-acting rule to caller sanity checks Match the rule's wording to its source: caller sanity checks (argument validation) before any meaningful action, unless there is a good reason to wait. --- CODE_STYLE.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/CODE_STYLE.md b/CODE_STYLE.md index 977aac9..8c44467 100644 --- a/CODE_STYLE.md +++ b/CODE_STYLE.md @@ -69,9 +69,8 @@ where this was done and then reverted). ## Validate before acting -Check a function's caller-supplied arguments and its preconditions -before taking any meaningful action — before any side effect — unless -there is a good reason to wait. +Do caller sanity checks (argument validation) before taking any +meaningful action, unless there is a good reason to wait. ## Closing non-indentable blocks