huonw / spellck

A spell-checker for Rust code.
Apache License 2.0
18 stars 4 forks source link

Code blocks in documentation are spell checked #13

Open sfackler opened 10 years ago

sfackler commented 10 years ago
#![feature(phase)]
#[phase(plugin)]
extern crate spellck;

/// ```rust
/// println!("{}", "sup?");
/// ```
pub fn it_works() {
}
/home/sfackler/test/src/lib.rs:6:1: 6:28 warning: misspelled word: println, #[warn(misspellings)] on by default
/home/sfackler/test/src/lib.rs:6 /// println!("{}", "sup?");
                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~
huonw commented 10 years ago

This is a little annoying to fix, doing it properly requires embedding a markdown parser (or reusing the one in rustdoc). A hack workaround is to have a dictionary file with these common words (fsvo common), e.g. https://github.com/huonw/spellck/blob/01ccbbbbd35bdfde1e8f01314cf68b08099c95de/src/stdlib.txt

(It would be neat to spellcheck any comments inside the code blocks.)