Add typing for AppSec::Extensions and Gateway::Watcher#5442
Add typing for AppSec::Extensions and Gateway::Watcher#5442
Conversation
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Typing analysisNote: Ignored files are excluded from the next sections. Untyped methodsThis PR clears 1 untyped method. It increases the percentage of typed methods from 61.16% to 61.21% (+0.05%). Untyped methods (+0-1)✅ Cleared: |
|
✅ Tests 🎉 All green!❄️ No new flaky tests detected 🎯 Code Coverage (details) 🔗 Commit SHA: 99362ae | Docs | Datadog PR Page | Was this helpful? React with 👍/👎 or give us feedback! |
BenchmarksBenchmark execution time: 2026-03-12 09:18:36 Comparing candidate commit 99362ae in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 46 metrics, 0 unstable metrics.
|
What does this PR do?
Replaces
-> untypedwith-> voidin two AppSec module methods whose return values are never used by callers.Motivation:
voidis semantically correct for methods that exist for side effects only, and communicates that callers should not depend on the return value.Change log entry
None.
Additional Notes:
AppSec::Extensions.activate!callsextendfor its side effect; return is unused.Monitor::Gateway::Watcher.watchcallswatch_user_id+watch_user_login, both already typed-> void.rate_limiter.rbandcompressed_json.rbunchanged: block returns andJSON.dumppayload are genuinelyuntyped.How to test the change?
bundle exec steep check lib/datadog/appsec/extensions.rb lib/datadog/appsec/monitor/gateway/watcher.rb