[tasks.compile-list]
env = { "CARGO_MAKE_RUST_SCRIPT_PROVIDER" = "cargo-play" }
script_runner = "@rust"
script = '''
//# psl-codegen = "0.9.3"

fn main() {
    let list = psl_codegen::compile_psl("data/public_suffix_list.dat");

    let module = format!("
	//! This file is automatically @generated by cargo-make.
	//! It is not intended for manual editing.

        #![allow(clippy::all)] // TODO lint this code?

        {}", list);

    std::fs::write("src/list.rs", module).unwrap();
}
'''

[tasks.format]
install_crate = "rustfmt"
command = "cargo"
args = ["fmt"]
dependencies = ["compile-list"]

[tasks.check]
command = "cargo"
args = ["check"]
dependencies = ["format"]

[tasks.build]
command = "cargo"
args = ["build"]
dependencies = ["format"]

[tasks.clippy]
command = "cargo"
args = ["clippy"]
dependencies = ["format"]

[tasks.test]
command = "cargo"
args = ["test"]
dependencies = ["format"]
