Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workaround Even Better TOML crash related to allOf #15992

Merged
merged 1 commit into from
Feb 6, 2025

Conversation

MichaReiser
Copy link
Member

@MichaReiser MichaReiser commented Feb 6, 2025

Summary

Fixes #15978

Even Better TOML doesn't support allOf well. In fact, it just crashes.

This PR works around this limitation by avoid using allOf in the automatically
derived schema for the docstring formatting setting.

Alternatives

schemars introduces allOf whenver it sees a $ref alongside other object properties
because this is no longer valid according to Draft 7. We could replace the
visitor performing the rewrite but I prefer not to because replacing allOf with oneOf
is only valid for objects that don't have any other oneOf or anyOf schema.

Test Plan

Screen.Recording.2025-02-06.at.13.01.50.mov

@MichaReiser MichaReiser added configuration Related to settings and configuration bug Something isn't working labels Feb 6, 2025
Copy link
Contributor

github-actions bot commented Feb 6, 2025

ruff-ecosystem results

Formatter (stable)

✅ ecosystem check detected no format changes.

Formatter (preview)

✅ ecosystem check detected no format changes.

@MichaReiser MichaReiser merged commit 7cac0da into main Feb 6, 2025
21 checks passed
@MichaReiser MichaReiser deleted the micha/workaround-better-toml-crash branch February 6, 2025 15:00
Copy link
Contributor

@ntBre ntBre left a comment

Choose a reason for hiding this comment

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

I'm a bit late, but thanks for tagging me! I hadn't looked into the schema stuff yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working configuration Related to settings and configuration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Even Better TOML crashes on ruff.toml due to allOf usage
3 participants