Detect :emoji:
in documentation and suggest using Unicode emoji directly
#13666
Labels
A-lint
Area: New lints
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 ofstd::thread::available_parallelism
. That said, that isn't a problem when following the best practice of writing paths like that inbackquotes
,Example
See the README of https://crates.io/crates/wtransport/0.4.0 for examples like
:rocket:
.The text was updated successfully, but these errors were encountered: