-
Notifications
You must be signed in to change notification settings - Fork 83
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
Add off-by-default lint to forbid relative pathing #150
Add off-by-default lint to forbid relative pathing #150
Conversation
src/dreammaker/config.rs
Outdated
@@ -29,6 +30,14 @@ pub struct Langserver { | |||
pub dreamchecker: bool, | |||
} | |||
|
|||
#[derive(Deserialize, Default, Debug, Clone)] | |||
pub struct CodeStandards { | |||
#[serde(default)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This probably belongs on the struct rather than on only one of the two field
src/dreammaker/objtree.rs
Outdated
@@ -1008,7 +1014,7 @@ impl ObjectTree { | |||
elems.len() + 1, | |||
Default::default(), | |||
Default::default(), | |||
) | |||
).and(Ok(())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rather see (...)?; Ok(())
than this use of .and()
, ditto below
src/dreammaker/config.rs
Outdated
@@ -74,6 +83,10 @@ impl Config { | |||
pub fn registerable_error(&self, error: &DMError) -> bool { | |||
self.display.error_level.applies_to(error.severity()) | |||
} | |||
|
|||
pub fn code_standards(&self) -> &CodeStandards { | |||
&self.code_standards |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's probably fine if this is a pub
field but it's not that important either way
Closes #148
This detects type definitions without a leading
/
as relative though.