feat(xatu): report unquoted URI literals
This commit is contained in:
19
src/xatu/rules/unquoted_uri.rs
Normal file
19
src/xatu/rules/unquoted_uri.rs
Normal file
@@ -0,0 +1,19 @@
|
||||
use crate::{ast, rules::TokenRule};
|
||||
|
||||
pub struct UnquotedUri;
|
||||
|
||||
impl TokenRule for UnquotedUri {
|
||||
type Token = String;
|
||||
|
||||
const ID: &'static str = "unquoted_uri";
|
||||
|
||||
fn select(data: &ast::TokenData) -> Option<&Self::Token> {
|
||||
match data {
|
||||
ast::TokenData::Uri(uri) => Some(uri),
|
||||
}
|
||||
}
|
||||
|
||||
fn check(_token: &Self::Token) -> Option<&'static str> {
|
||||
Some("URI literals should be quoted")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user