Skip to content

Commit

Permalink
catch missing project root mentions
Browse files Browse the repository at this point in the history
Turns out I forgot to write this file after I made the change. Whooooooops!
  • Loading branch information
BrianHicks committed Nov 20, 2020
1 parent 403dd3a commit 4944a84
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/store.rs
Expand Up @@ -88,7 +88,7 @@ impl Store {
)),
},
None => Err(anyhow!(
"root config path ({}) does not have a parent.",
"config path ({}) does not have a parent.",
self.config_path.display()
)),
}
Expand All @@ -108,7 +108,7 @@ impl Store {
}

None => Err(anyhow!(
"root config path ({}) does not have a parent.",
"config path ({}) does not have a parent.",
self.config_path.display(),
)),
}
Expand All @@ -117,17 +117,17 @@ impl Store {
pub fn add_root(&mut self, path: PathBuf) -> Result<()> {
self.roots.insert(
self.relative_to_config_path(path)
.context("could not find a path from the config file to the new root")?,
.context("could not find a path from the config file to the new project root")?,
);

Ok(())
}

pub fn remove_root(&mut self, path: PathBuf) -> Result<()> {
self.roots.remove(
&self
.relative_to_config_path(path)
.context("could not find a path from the config file to the root to remove")?,
&self.relative_to_config_path(path).context(
"could not find a path from the config file to the project root to remove",
)?,
);

Ok(())
Expand All @@ -154,7 +154,7 @@ impl Store {
pub fn update(&mut self) -> Result<()> {
let imports_to_files = self
.scan()
.context("could not scan the roots for Elm files")?;
.context("could not scan the project roots for Elm files")?;

for (import, existing) in self.forbidden.iter_mut() {
existing.usages = match imports_to_files.get(import) {
Expand All @@ -172,7 +172,7 @@ impl Store {
pub fn check(&mut self) -> Result<Vec<CheckResult>> {
let imports_to_files = self
.scan()
.context("could not scan the roots for Elm files")?;
.context("could not scan the project roots for Elm files")?;
let mut out = Vec::new();

for (import, existing) in self.forbidden.iter() {
Expand Down

0 comments on commit 4944a84

Please sign in to comment.