Skip to content

linter: split require-timeout-settings into require-lock-timeout and require-statement-timeout#1

Merged
zvdy merged 1 commit into
masterfrom
zvdy/granular-timeout-rules
Jul 9, 2026
Merged

linter: split require-timeout-settings into require-lock-timeout and require-statement-timeout#1
zvdy merged 1 commit into
masterfrom
zvdy/granular-timeout-rules

Conversation

@zvdy

@zvdy zvdy commented Jul 8, 2026

Copy link
Copy Markdown
Owner

Fixes sbdchd#1231

What

Splits the require-timeout-settings rule into two independent rules so each timeout check can be enabled/disabled on its own:

  • require-lock-timeout — warns when set lock_timeout is missing before potentially slow operations
  • require-statement-timeout — warns when set statement_timeout is missing before potentially slow operations

Both are enabled by default (same effective default behavior as before, only the violation codes change).

Backwards compatibility

require-timeout-settings is kept as a deprecated alias that expands to both granular rules:

  • excluded_rules = ["require-timeout-settings"] still disables both checks
  • included_rules = ["require-timeout-settings"] enables both
  • -- squawk-ignore require-timeout-settings comments still suppress both violations
  • exclude wins over include: excluding require-statement-timeout while including the alias leaves only the lock check enabled

Example

$ squawk --exclude=require-statement-timeout mig.sql
mig.sql:0:0: warning: require-lock-timeout Missing `set lock_timeout` before potentially slow ACCESS EXCLUSIVE lock operations

Changes

  • squawk_linter: new Rule::RequireLockTimeout / Rule::RequireStatementTimeout variants; the shared check in require_timeout_settings.rs now gates each report on its own rule and reports under the granular codes; alias expansion in Linter::from, Linter::with_rules, and squawk-ignore parsing
  • tests for granular enable/disable, alias expansion in config and ignore comments; regenerated affected snapshots
  • docs: new require-lock-timeout / require-statement-timeout pages, deprecation note on require-timeout-settings, sidebar + homepage rule list updates
  • CHANGELOG entry

Split require-timeout-settings into require-lock-timeout and
require-statement-timeout so each timeout check can be enabled or
disabled individually. require-timeout-settings remains as a deprecated
alias that expands to both rules in config includes/excludes and
squawk-ignore comments.

Refs sbdchd#1231

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XRd5kooj79N8aLiQSzLqjG
@zvdy zvdy merged commit a9daba3 into master Jul 9, 2026
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.

add timeout rule granularity

2 participants