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

Detect :emoji: in documentation and suggest using Unicode emoji directly #13666

Open
joshtriplett opened this issue Nov 8, 2024 · 0 comments
Labels
A-lint Area: New lints

Comments

@joshtriplett
Copy link
Member

What it does

If you use :emoji: (e.g. :rocket: for 🚀 or :crab: for 🦀) in documentation (e.g. README.md), it'll show up properly on github, but then not work in other places such as crates.io that don't include :emoji: support in their Markdown renderer.

Clippy could detect some of the most common emoji in documentation, and emit a rustfix-enabled suggestion to use the real Unicode emoji character instead.

Note: I'm not suggesting having a complete, comprehensive list of emoji names for detection, not least of which because that'd be more prone to false positives. I'm suggesting checking for the top few dozen commonly used emoji names.

Advantage

No response

Drawbacks

False positives. For instance, :thread: gets detected in the middle of std::thread::available_parallelism. That said, that isn't a problem when following the best practice of writing paths like that in backquotes,

Example

See the README of https://crates.io/crates/wtransport/0.4.0 for examples like :rocket:.

@joshtriplett joshtriplett added the A-lint Area: New lints label Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lint Area: New lints
Projects
None yet
Development

No branches or pull requests

1 participant