Skip to content

Opt mssql-odbc into the workspace lint configuration - #476

Merged
Saurabh Singh (saurabh500) merged 1 commit into
mainfrom
dev/saurabh/odbc-workspace-lints
Sep 2, 2026
Merged

Opt mssql-odbc into the workspace lint configuration#476
Saurabh Singh (saurabh500) merged 1 commit into
mainfrom
dev/saurabh/odbc-workspace-lints

Conversation

@saurabh500

@saurabh500 Saurabh Singh (saurabh500) commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Description

mssql-odbc was the only workspace member without a [lints] section, so it inherited none of the workspace lint configuration. This adds the two lines that opt it in:

[lints]
workspace = true

Why it was missing. The crate predates the lint setup. 523cf5f7 (2026-04-30) added [workspace.lints] and opted in the four members that existed at the time; mssql-odbc arrived later, on 2026-07-08 via 5d375afc, as an import from a separate codebase. git log -S'[lints]' -- mssql-odbc/Cargo.toml returns nothing — the section was never there.

[workspace.lints] is a definition table, not an application table. Members inherit only via an explicit [lints] workspace = true, the same opt-in pattern as [workspace.dependencies].

What it was exempt from. unexpected_cfgs, plus the three currently-active clippy lints — await_holding_lock, await_holding_refcell_ref and large_futures. Those are the async-correctness rules (deadlock and oversized-future detection), and mssql-odbc is a heavily async crate that boxes future state deliberately, so it is an unfortunate one to have exempt.

Why it went unnoticed. cargo clippy -p mssqlodbc still emits plenty of warnings, but they all originate in mssql-tds as a path dependency. A raw warning count looks healthy and hides the gap completely — attributing warnings by file path via --message-format=json is what surfaces it.

Verification

Confirmed the lints now actually reach the crate, by inspecting the rustc invocation (cargo clippy -p mssqlodbc -v):

--warn=clippy::await_holding_lock
--warn=clippy::await_holding_refcell_ref
--warn=clippy::large_futures
--warn=unexpected_cfgs

None of these were passed before this change. Zero new warnings result, so this is purely closing the gap rather than a behaviour change — no source files are touched.

Follow-up, deliberately not in this PR

The other 35 lints in [workspace.lints.clippy] remain commented out workspace-wide. For sizing, mssql-odbc alone would emit 682 warnings in production code (--lib) and 3,351 including tests if all 38 were switched on. undocumented_unsafe_blocks (1,786) and unwrap_used (999) are 83% of that, and every unwrap_used hit is in test code. Those numbers are recorded in #475 so the staged lints can be adopted per-lint rather than all at once.

Related Issues

Fixes #475

Checklist

  • cargo bfmt passes
  • cargo bclippy passes
  • cargo btest passes — 3,116/3,120 unit tests pass, all mssqlodbc tests green. The 4 failures are the pre-existing certificate_validator fixture tests (they need mssql-tds/tests/test_certificates/generate_certs.sh); integration suites need a .env with a live server. Both are environmental and fail identically on main.
  • New/changed functionality has tests — n/a, build configuration only
  • Public API changes are documented — n/a, no API change

mssql-odbc was the only workspace member without a [lints] section, so it
inherited none of the workspace lints. The crate predates the lint setup:
the infrastructure landed in 523cf5f and opted in the four members that
existed then, and mssql-odbc arrived later in 5d375af as an import from a
separate codebase.

This exempted it from unexpected_cfgs and the three active clippy lints,
which are the async-correctness rules -- await_holding_lock,
await_holding_refcell_ref and large_futures -- on a heavily async crate.

The gap was easy to miss because `cargo clippy -p mssqlodbc` still reports
plenty of warnings; they come from mssql-tds as a path dependency, so the
raw count looks healthy.

No new warnings result, so this is purely closing the gap.

Fixes #475

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

📊 Code Coverage Report

🔥 Diff Coverage

100%

🎯 Overall Coverage

93.3%

📦 Project: mssql-tds + mssql-odbc + mssql-py-core
ℹ️ Note: diff coverage is reported, not enforced.


Diff Coverage

Diff: main...HEAD, staged and unstaged changes

No lines with coverage information in this diff.


🔗 Quick Links

View Azure DevOps Build · Coverage Report

@saurabh500
Saurabh Singh (saurabh500) marked this pull request as ready for review September 2, 2026 17:29
@saurabh500
Saurabh Singh (saurabh500) requested a review from a team as a code owner September 2, 2026 17:29
Copilot AI balanced review requested due to automatic review settings September 2, 2026 17:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The manifest change is correct, scoped, and consistent with other workspace members.

Pull request overview

Opts mssql-odbc into the workspace lint configuration, aligning it with other workspace crates.

Changes:

  • Enables inherited Rust and Clippy workspace lints.
  • No runtime or API changes.
File summaries
File Description
mssql-odbc/Cargo.toml Enables workspace lint inheritance.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Balanced

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@Theekshna ttk (Theekshna) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unattended run — no findings. This is a 3-line Cargo.toml-only change ([lints]\nworkspace = true for mssql-odbc), no source touched.

Verified:

  • git diff against the merge-base matches the PR's own reported stats exactly (3/0/1 file).
  • The lint set the PR claims mssql-odbc was missing — unexpected_cfgs, await_holding_lock, await_holding_refcell_ref, large_futures — matches [workspace.lints] in the root Cargo.toml exactly; every other clippy lint listed there is commented out, so nothing else is newly enabled.
  • Ran cargo clippy -p mssqlodbc --all-targets --offline at this head: zero warnings, confirming the PR's "zero new warnings" claim rather than trusting it.
  • No merge-conflict markers; baseRefName (main) matches the PR's target.

msodbcsql parity: N/A, no ODBC behavior touched. Test sufficiency: N/A for a lint-config change — the clippy run above is the applicable verification and it passed clean. Divergences: N/A. PR description: matches the diff exactly, linked to #475, checklist claims consistent with the change's scope. No AI slop — no new comments or prose added.

CI: Azure DevOps validation still running on this head (build 171909) at review time; copilot-pull-request-reviewer[bot] already recommended approval.

Category Count
Blocking 0
Suggestion 0
Nit 0

@Theekshna ttk (Theekshna) added the ready for human review Automation flag indicating an item is ready for human review. label Sep 2, 2026
@saurabh500
Saurabh Singh (saurabh500) merged commit 06a8ee7 into main Sep 2, 2026
21 checks passed
@saurabh500
Saurabh Singh (saurabh500) deleted the dev/saurabh/odbc-workspace-lints branch September 2, 2026 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready for human review Automation flag indicating an item is ready for human review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mssql-odbc does not inherit [workspace.lints] — it has no [lints] section

4 participants