Skip to content

feat: Add Level::None for omitting the header #171

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

BurntSushi
Copy link
Member

When combined with an empty title, this results in the header being
omitted entirely.

This isn't what @epage suggested in #167 since changing our rendering to
pass in a custom header is a bigger refactor than what I've been able to
get to. The goal of this change was to be very small without requiring
bigger code changes on our end. Unfortunately, this is a breaking
change, so I'm not sure what the appetite is for this.

Fixes #167

When combined with an empty `title`, this results in the header being
omitted entirely.

This isn't what @epage suggested in rust-lang#167 since changing our rendering to
pass in a custom header is a bigger refactor than what I've been able to
get to. The goal of this change was to be very small without requiring
bigger code changes on our end. Unfortunately, this is a breaking
change, so I'm not sure what the appetite is for this.

Fixes rust-lang#167
@ZedThree
Copy link

ZedThree commented Jan 9, 2025

I have a practically identical change in #159 for very similar reasons :)

@BurntSushi
Copy link
Member Author

Ah nice, whoops, missed that!

facebook-github-bot pushed a commit to facebookincubator/reindeer that referenced this pull request Jun 11, 2025
Summary:
I want to use [annotate-snippets](https://github.com/rust-lang/annotate-snippets-rs) to format code snippets in error messages. Unfortunately, annotate-snippets [always prints a non-customizable level label](rust-lang/annotate-snippets-rs#167), and a [proposed patch](rust-lang/annotate-snippets-rs#171) to fix this has been sitting unreviewed since January.

Ruff has forked annotate-snippets and applied this patch, along with a couple other bug fixes. We could do the same thing (fork annotate-snippets ourselves), but it's simpler for now to reuse the Ruff fork.

I followed the instructions here to bring in a new Rust library: https://www.internalfb.com/wiki/Rust/Third_Party_Libraries/Adding_or_Updating_Libraries/.

Reviewed By: yangdanny97

Differential Revision: D76367898

fbshipit-source-id: 2b4727790c8b7d1d7b7028bc34e2f577cef8864c
@ndmitchell
Copy link
Contributor

I'm also after pretty much the same change. Any chance this could be reviewed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

enable a way to elide the message "header"
3 participants