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

repo: lint for correct tracing of errors? #718

Open
chris-oo opened this issue Jan 24, 2025 · 1 comment
Open

repo: lint for correct tracing of errors? #718

chris-oo opened this issue Jan 24, 2025 · 1 comment
Labels
linting Changes for better linting and/or their cleanups

Comments

@chris-oo
Copy link
Member

chris-oo commented Jan 24, 2025

Have a lint that fires in the following case:

                        tracelimit::error_ratelimited!(?err, ?offer_id, "could not open channel",);
                        tracelimit::error_ratelimited!(err = err.as_ref() as &dyn std::error::Error, ?offer_id, "could not open channel",);

we want to always require the 2nd, as the first doesn't log the whole error chain.

Originally posted by @SvenGroot in #717 (comment)

@smalis-msft smalis-msft added the linting Changes for better linting and/or their cleanups label Jan 24, 2025
@smalis-msft
Copy link
Contributor

Is there a change we could make to tracing instead to do the right thing here somehow? Currently all our lints are purely text-based, and there's no way to have enough type-information to be able to do this. We'd need to invest in setting up something much more involved, like cargo-dylint.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
linting Changes for better linting and/or their cleanups
Projects
None yet
Development

No branches or pull requests

2 participants