Skip to content

Workaround Even Better TOML crash related to allOf#15992

Merged
MichaReiser merged 1 commit intomainfrom
micha/workaround-better-toml-crash
Feb 6, 2025
Merged

Workaround Even Better TOML crash related to allOf#15992
MichaReiser merged 1 commit intomainfrom
micha/workaround-better-toml-crash

Conversation

@MichaReiser
Copy link
Copy Markdown
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
@github-actions
Copy link
Copy Markdown
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
@MichaReiser MichaReiser deleted the micha/workaround-better-toml-crash branch February 6, 2025 15:00
Copy link
Copy Markdown
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