Skip to content

chore: enforce @override via mypy explicit-override rule#12451

Merged
HyeockJinKim merged 2 commits into
mainfrom
chore/enable-explicit-override
Jul 2, 2026
Merged

chore: enforce @override via mypy explicit-override rule#12451
HyeockJinKim merged 2 commits into
mainfrom
chore/enable-explicit-override

Conversation

@fregataa

@fregataa fregataa commented Jun 30, 2026

Copy link
Copy Markdown
Member

Summary

  • Enable mypy's explicit-override error code ([tool.mypy].enable_error_code) so every method overriding a base-class method must carry @typing.override.
  • Add the 2679 missing @override decorators across 609 files (driven by mypy's own diagnostics for precision, including cross-module base classes).
  • Exempt ai.backend.client.cli.pretty per-module: its total property overrides tqdm's total, which is an instance attribute (not a method), and mypy cannot recognise @override on a property overriding a base variable regardless of decorator placement.

Test plan

  • pants check :: → Success, no issues found in 6291 source files
  • pants lint --changed-since=origin/main → All checks passed
  • pants fmt :: && pants fix :: → clean

📚 Documentation preview 📚: https://sorna--12451.org.readthedocs.build/en/12451/


📚 Documentation preview 📚: https://sorna-ko--12451.org.readthedocs.build/ko/12451/

@fregataa fregataa requested a review from a team as a code owner June 30, 2026 06:55
@github-actions github-actions Bot added size:L 100~500 LoC comp:manager Related to Manager component comp:agent Related to Agent component comp:client Related to Client component comp:common Related to Common component comp:cli Related to CLI component comp:webserver Related to Web Server component comp:storage-proxy Related to Storage proxy component comp:app-proxy Related to App Proxy component labels Jun 30, 2026
fregataa added a commit that referenced this pull request Jun 30, 2026
@fregataa fregataa force-pushed the chore/enable-explicit-override branch from 9d97f14 to e092a21 Compare June 30, 2026 07:10
HyeockJinKim
HyeockJinKim previously approved these changes Jun 30, 2026
seedspirit
seedspirit previously approved these changes Jun 30, 2026
@fregataa fregataa marked this pull request as draft June 30, 2026 08:06
@fregataa fregataa dismissed stale reviews from seedspirit and HyeockJinKim via 2f4880e July 2, 2026 01:09
@fregataa fregataa force-pushed the chore/enable-explicit-override branch from e092a21 to 2f4880e Compare July 2, 2026 01:09
@fregataa fregataa changed the base branch from main to fix/model-registry-test-isolation July 2, 2026 01:09
Base automatically changed from fix/model-registry-test-isolation to main July 2, 2026 01:19
@github-actions github-actions Bot added size:XL 500~ LoC area:docs Documentations and removed size:L 100~500 LoC labels Jul 2, 2026
@fregataa fregataa force-pushed the chore/enable-explicit-override branch 2 times, most recently from cb72e5e to 01901b0 Compare July 2, 2026 01:47
@github-actions github-actions Bot added size:L 100~500 LoC size:XL 500~ LoC and removed size:XL 500~ LoC size:L 100~500 LoC labels Jul 2, 2026
@fregataa fregataa force-pushed the chore/enable-explicit-override branch from 1f7d263 to 67a0f1e Compare July 2, 2026 05:01
@github-actions github-actions Bot added size:L 100~500 LoC and removed size:XL 500~ LoC labels Jul 2, 2026
fregataa added a commit that referenced this pull request Jul 2, 2026
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@fregataa fregataa force-pushed the chore/enable-explicit-override branch from 32c21ed to a70040f Compare July 2, 2026 05:34
fregataa added a commit that referenced this pull request Jul 2, 2026
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@fregataa fregataa force-pushed the chore/enable-explicit-override branch from a70040f to 6df924c Compare July 2, 2026 05:46
@fregataa fregataa marked this pull request as ready for review July 2, 2026 05:55
Copilot AI review requested due to automatic review settings July 2, 2026 05:55

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.

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

@fregataa fregataa marked this pull request as draft July 2, 2026 05:56
@github-actions github-actions Bot added size:XL 500~ LoC and removed size:L 100~500 LoC labels Jul 2, 2026
@fregataa fregataa force-pushed the chore/enable-explicit-override branch from d128459 to 6df924c Compare July 2, 2026 06:09
fregataa and others added 2 commits July 2, 2026 15:25
Enable mypy's explicit-override error code and add the 2672 missing
@OverRide decorators across 609 files, driven by mypy's own diagnostics.
Every method overriding a base-class method now carries @typing.override.

ai.backend.client.cli.pretty is exempted per-module: its `total` property
overrides tqdm's `total` instance attribute (not a method), which mypy
cannot recognise @OverRide on regardless of decorator placement.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@fregataa fregataa force-pushed the chore/enable-explicit-override branch from 7b8d426 to 7c5241b Compare July 2, 2026 06:25
@fregataa fregataa marked this pull request as ready for review July 2, 2026 06:29
@github-actions github-actions Bot added size:L 100~500 LoC and removed size:XL 500~ LoC labels Jul 2, 2026
@fregataa fregataa requested a review from a team July 2, 2026 06:46
@HyeockJinKim HyeockJinKim merged commit 5bb7a7f into main Jul 2, 2026
35 of 36 checks passed
@HyeockJinKim HyeockJinKim deleted the chore/enable-explicit-override branch July 2, 2026 06:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:docs Documentations comp:agent Related to Agent component comp:app-proxy Related to App Proxy component comp:cli Related to CLI component comp:client Related to Client component comp:common Related to Common component comp:manager Related to Manager component comp:storage-proxy Related to Storage proxy component comp:webserver Related to Web Server component size:L 100~500 LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants