Skip to content

fix(no-floating-promises): respect safe-call declaration sources - #1261

Merged
graphite-app[bot] merged 1 commit into
mainfrom
codex/fix-safe-call-source-1260
Oct 6, 2026
Merged

graphite-app[bot] merged 1 commit into
mainfrom
codex/fix-safe-call-source-1260

Conversation

@camc314

@camc314 camc314 commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

File-qualified allowForKnownSafeCalls entries currently exempt unrelated local functions with the same name, even when the configured file does not exist. Match the value symbol's declaration source for file, library, and package specifiers, resolving imported aliases before checking provenance. Bare-name allowances retain their existing behavior.

Use the value symbol rather than its type symbol so the shared matcher also preserves no-deprecated allowances for primitive-valued declarations. Regression tests cover exact and missing files, imported aliases, library selectors, and name-only allowances.

Fixes #1260

Copilot AI balanced review requested due to automatic review settings October 5, 2026 18:40
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-05T21:38:10.684848Z 7d49e73 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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.

Copilot review overview

🟡 Changes recommended

Shorthand property references still use the wrong declaration source, breaking file-qualified deprecation allowances.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Fixes #1260 by checking declaration sources for qualified safe-call allowances in the shared matcher.

Changes:

  • Resolves imported aliases before checking file, library, or package provenance.
  • Updates both rule callers to pass the type checker.
  • Adds safe-call regression tests and diagnostic snapshots.
File Description
internal/​utils/​type_matches_specifier.go Checks value-symbol declaration sources.
internal/​rules/​no_floating_promises/​no_floating_promises.go Passes the checker to the matcher.
internal/​rules/​no_floating_promises/​no_floating_promises_test.go Adds source-qualified allowance tests.
internal/​rules/​no_deprecated/​no_deprecated.go Updates the shared matcher call.
internal/​rule_tester/​__snapshots__/​no-floating-promises.snap Records regression diagnostics.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6f79536f67

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@camc314 camc314 self-assigned this Oct 6, 2026
@camc314 camc314 added the 0-merge label Oct 6, 2026

camc314 commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor Author

Merge activity

File-qualified `allowForKnownSafeCalls` entries currently exempt unrelated local functions with the same name, even when the configured file does not exist. Match the value symbol's declaration source for file, library, and package specifiers, resolving imported aliases before checking provenance. Bare-name allowances retain their existing behavior.

Use the value symbol rather than its type symbol so the shared matcher also preserves `no-deprecated` allowances for primitive-valued declarations. Regression tests cover exact and missing files, imported aliases, library selectors, and name-only allowances.

Fixes #1260
@graphite-app
graphite-app Bot force-pushed the codex/fix-safe-call-source-1260 branch from 7d49e73 to 24b18b4 Compare October 6, 2026 10:45
@graphite-app
graphite-app Bot merged commit 24b18b4 into main Oct 6, 2026
9 checks passed
@graphite-app graphite-app Bot removed the 0-merge label Oct 6, 2026
@graphite-app
graphite-app Bot deleted the codex/fix-safe-call-source-1260 branch October 6, 2026 10:52
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.

no-floating-promises: file-qualified safe-call allowance exempts unrelated local functions

2 participants