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

Add off-by-default lint to forbid relative pathing #150

Merged
merged 3 commits into from
Jan 22, 2020

Conversation

spookydonut
Copy link
Collaborator

@spookydonut spookydonut commented Jan 15, 2020

Closes #148

This detects type definitions without a leading / as relative though.

@@ -29,6 +30,14 @@ pub struct Langserver {
pub dreamchecker: bool,
}

#[derive(Deserialize, Default, Debug, Clone)]
pub struct CodeStandards {
#[serde(default)]
Copy link
Owner

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

@@ -1008,7 +1014,7 @@ impl ObjectTree {
elems.len() + 1,
Default::default(),
Default::default(),
)
).and(Ok(()))
Copy link
Owner

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

@@ -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
Copy link
Owner

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

@SpaceManiac SpaceManiac changed the title Adds extremely opinionated code standard linting Add extremely opinionated code standard linting Jan 21, 2020
@SpaceManiac SpaceManiac changed the title Add extremely opinionated code standard linting Add off-by-default lint to forbid relative pathing Jan 22, 2020
@SpaceManiac SpaceManiac merged commit 9dbcfef into SpaceManiac:master Jan 22, 2020
@spookydonut spookydonut deleted the extremelyopinionated branch January 26, 2020 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Warn about relative pathing
2 participants