Skip to content

chore: scope the docs name-exactness rule to sqlguard's own API - #86

Merged
KARTIKrocks merged 1 commit into
mainfrom
fix/docs-name-rule-scope
Sep 25, 2026
Merged

KARTIKrocks merged 1 commit into
mainfrom
fix/docs-name-rule-scope

Conversation

@KARTIKrocks

@KARTIKrocks KARTIKrocks commented Sep 25, 2026 •

Copy link
Copy Markdown
Owner

User description

Follow-up to the CodeAnt nitpick on #85.

What it flagged

interpolateParams in website/docs/middleware.md:102, against the
website-docs-version-markers rule that #84 added:

Every option, function and rule name in the docs must match an exported
identifier or a registered rule name exactly.

It was right, and the rule was wrong

Read literally, that is exactly what the rule demands — and the docs are full
of names this project does not own: sql.Open, sql.OpenDB,
stdlib.GetConnector, gorm.Plugin, bun.QueryHook, pgxpool.Pool,
standard_conforming_strings, sql_mode. Every one of them is a violation
under that wording. interpolateParams was simply the one that appeared in a
diff.

The intent was always narrower: a name presented as sqlguard's own must
exist, because a wrong one sends a reader looking for an API that isn't there.
A correctly spelled upstream name does the opposite — it tells them exactly
what to look up. The rule now says so.

Changed in the four places the rule lives

.codeant/review.json, .greptile/config.json, .coderabbit.yaml and
AGENTS.md — the sync discipline AGENTS.md describes, on its first outing:

The same applies in reverse: a rule that turns out to be wrong is wrong in
three places.

The interpolateParams line in website/docs/middleware.md is unchanged and
stays in #85; it is accurate (go-sql-driver/mysql interpolates client-side
only when that DSN parameter is on, which is what makes ErrSkip the common
path on MySQL).


CodeAnt-AI Description

Limit documentation name checks to sqlguard’s own API

What Changed

  • Documentation review rules now require exact names only for sqlguard options, functions, types, and rules.
  • Correct names from the standard library, drivers, ORMs, and databases are accepted when they match their upstream APIs.
  • The clarified rule is synchronized across the repository’s documentation review guidance.

Impact

✅ Fewer false-positive documentation review warnings
✅ Valid upstream API names remain usable in docs
✅ Clearer checks for sqlguard API references

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

CodeAnt flagged `interpolateParams` in website/docs/middleware.md against the
website-docs-version-markers rule, which says every option, function and rule
name in the docs must match an exported identifier or a registered rule name.
Read literally that is what the rule demands, so the reviewer was right and
the rule was wrong: the docs legitimately name identifiers this project does
not own — sql.Open, stdlib.GetConnector, gorm.Plugin, pgxpool.Pool,
standard_conforming_strings, sql_mode — and every one of them would be a
violation.

The intent was always that a name presented as sqlguard's own must exist,
because a wrong one sends readers looking for an API that isn't there. A
correctly spelled upstream name does the opposite. The rule now says so, in
the four places it lives: .codeant/review.json, .greptile/config.json,
.coderabbit.yaml and AGENTS.md.
@codeant-ai

codeant-ai Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

🤖 CodeAnt AI — Review Status

Status Commit Started (UTC) Finished (UTC)
✅ Reviewed your PR 601ffc3 Sep 25, 2026 · 12:05 12:07

@codeant-ai

codeant-ai Bot commented Sep 25, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@coderabbitai

coderabbitai Bot commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Repository: KARTIKrocks/sqlguard/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 7f1f58ff-1fd2-46ec-aeff-729a773ca11b


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codeant-ai

codeant-ai Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

🏁 CodeAnt Quality Gate Results

Commit: 601ffc3e
Scan Time: 2026-09-25 12:05:59 UTC

✅ Overall Status: PASSED

Quality Gate Details

Quality Gate Status Details
Secrets ✅ PASSED 0 secrets found
SAST ✅ PASSED No security issues
SCA (Dependencies) ✅ PASSED Rating S: No vulnerabilities

View Full Results

@codeant-ai codeant-ai Bot added the size:S This PR changes 10-29 lines, ignoring generated files label Sep 25, 2026
@KARTIKrocks
KARTIKrocks merged commit 0de1815 into main Sep 25, 2026
31 checks passed
@KARTIKrocks
KARTIKrocks deleted the fix/docs-name-rule-scope branch September 25, 2026 12:07
@codeant-ai

codeant-ai Bot commented Sep 25, 2026

Copy link
Copy Markdown

CodeAnt Nitpicks

2 code suggestions

1. The new requirement treats each fenced block as compilable, but analyzer.md uses fmt.Printf without importing fmt, causing a false documentation violation.

Logic error · .coderabbit.yaml:215-216


2. This rule can reject valid configuration keys such as disable, severity, settings, and dedup, which are not exported identifiers or registered rule names.

Api mismatch · AGENTS.md:100-102

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S This PR changes 10-29 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant