Skip to content

Add FutureWarning for upcoming ruff default formatters#2895

Merged
koxudaxi merged 1 commit intomainfrom
feat/future-warning-ruff-default
Jan 2, 2026
Merged

Add FutureWarning for upcoming ruff default formatters#2895
koxudaxi merged 1 commit intomainfrom
feat/future-warning-ruff-default

Conversation

@koxudaxi
Copy link
Copy Markdown
Owner

@koxudaxi koxudaxi commented Jan 2, 2026

Related Isses: #2775

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jan 2, 2026

Warning

Rate limit exceeded

@koxudaxi has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 3 minutes and 7 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between f4b240a and 162c156.

📒 Files selected for processing (12)
  • docs/formatting.md
  • pyproject.toml
  • src/datamodel_code_generator/__init__.py
  • src/datamodel_code_generator/__main__.py
  • src/datamodel_code_generator/_types/generate_config_dict.py
  • src/datamodel_code_generator/_types/parser_config_dicts.py
  • src/datamodel_code_generator/config.py
  • src/datamodel_code_generator/format.py
  • src/datamodel_code_generator/parser/base.py
  • tests/data/expected/main/input_model/config_class.py
  • tests/main/test_public_api_signature_baseline.py
  • tests/test_format.py

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 and usage tips.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 2, 2026

📚 Docs Preview: https://pr-2895.datamodel-code-generator.pages.dev

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Jan 2, 2026

CodSpeed Performance Report

Merging #2895 will not alter performance

Comparing feat/future-warning-ruff-default (162c156) with main (f4b240a)

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

Summary

✅ 11 untouched
⏩ 98 skipped1

Footnotes

  1. 98 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.37%. Comparing base (f4b240a) to head (162c156).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2895   +/-   ##
=======================================
  Coverage   99.37%   99.37%           
=======================================
  Files          92       92           
  Lines       16196    16214   +18     
  Branches     1915     1916    +1     
=======================================
+ Hits        16095    16113   +18     
  Misses         52       52           
  Partials       49       49           
Flag Coverage Δ
unittests 99.37% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@koxudaxi koxudaxi closed this Jan 2, 2026
@koxudaxi koxudaxi reopened this Jan 2, 2026
@koxudaxi koxudaxi force-pushed the feat/future-warning-ruff-default branch from 9f16913 to a97205b Compare January 2, 2026 10:32
@koxudaxi koxudaxi force-pushed the feat/future-warning-ruff-default branch from a97205b to 162c156 Compare January 2, 2026 10:34
@koxudaxi koxudaxi merged commit 2b45def into main Jan 2, 2026
43 checks passed
@koxudaxi koxudaxi deleted the feat/future-warning-ruff-default branch January 2, 2026 14:08
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 2, 2026

Breaking Change Analysis

Result: No breaking changes detected

Reasoning: This PR adds a FutureWarning to notify users about an upcoming change where the default formatters will switch from black/isort to ruff in a future version. The key points are:

  1. No Code Generation Changes: The generated code output remains identical - black and isort continue to be the default formatters. The warning is informational only.

  2. No API/CLI Breaking Changes: The formatters parameter type changed from list[Formatter] to list[Formatter] | None, but this is backwards compatible - existing code passing a list of formatters still works. The default behavior remains the same (black + isort).

  3. No Default Behavior Changes: When formatters=None (the new default), the code now emits a FutureWarning but then applies DEFAULT_FORMATTERS (black + isort) exactly as before. The actual formatting behavior is unchanged.

  4. Warning Only: This is a standard deprecation pattern - warn users about future changes without breaking existing functionality. Users can suppress the warning by explicitly specifying formatters or using --disable-warnings.

  5. Documentation Update: Added warning notices to docs about the upcoming change, but no functional changes.

The PR is explicitly designed to NOT be breaking - it prepares users for a future breaking change by warning them, while maintaining full backwards compatibility.


This analysis was performed by Claude Code Action

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 2, 2026

🎉 Released in 0.52.0

This PR is now available in the latest release. See the release notes for details.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants