Skip to content

Commit

Permalink
Remove deprecated config key and template filters
Browse files Browse the repository at this point in the history
  • Loading branch information
rossmacarthur committed Aug 25, 2024
1 parent 2f68940 commit d024b3b
Show file tree
Hide file tree
Showing 8 changed files with 2 additions and 67 deletions.
16 changes: 2 additions & 14 deletions src/config/normalize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,31 +83,19 @@ fn normalize_plugin(
remote,
local,
inline,
mut proto,
proto,
reference,
dir,
uses,
apply,
profiles,
hooks,
mut rest,
rest,
} = raw_plugin;

let is_reference_some = reference.is_some();
let is_gist_or_github = gist.is_some() || github.is_some();

// Handle some deprecated items :/
if proto.is_none() {
if let Some(protocol) = try_pop_toml_value(&mut rest, "protocol") {
warnings.push(anyhow!(
"use of deprecated config key: `plugins.{name}.protocol`, please use \
`plugins.{name}.proto` instead",
name = name,
));
proto = Some(protocol);
}
}

check_extra_toml(rest, |key| {
warnings.push(anyhow!("unused config key: `plugins.{name}.{key}`"));
});
Expand Down
8 changes: 0 additions & 8 deletions src/lock/script.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,6 @@ impl LockedConfig {
}
}

if *USED_GET.lock().unwrap() {
warnings.push(Error::msg(
"use of deprecated filter `get` in [templates], please use the `?.` operator \
instead.\nFor example: `{{ hooks | get: \"pre\" | nl }}` can be written `{{ \
hooks?.pre | nl }}`",
));
}

Ok(script)
}
}
8 changes: 0 additions & 8 deletions tests/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -422,14 +422,6 @@ fn lock_and_source_hooks() -> io::Result<()> {
Ok(())
}

#[test]
fn lock_and_source_deprecated_get_filter() -> io::Result<()> {
let case = TestCase::load("deprecated_get_filter")?;
case.run()?;
check_sheldon_test(&case.dirs.data).unwrap();
Ok(())
}

#[test]
fn directories_default() -> io::Result<()> {
let dirs = TestDirs::default()?;
Expand Down
3 changes: 0 additions & 3 deletions tests/testdata/deprecated_get_filter/lock.stderr

This file was deleted.

21 changes: 0 additions & 21 deletions tests/testdata/deprecated_get_filter/plugins.lock

This file was deleted.

7 changes: 0 additions & 7 deletions tests/testdata/deprecated_get_filter/plugins.toml

This file was deleted.

5 changes: 0 additions & 5 deletions tests/testdata/deprecated_get_filter/source.stderr

This file was deleted.

1 change: 0 additions & 1 deletion tests/testdata/deprecated_get_filter/source.stdout

This file was deleted.

0 comments on commit d024b3b

Please sign in to comment.