diff --git a/.rusty-hook.toml b/.rusty-hook.toml index 8487a649..83bfdd54 100644 --- a/.rusty-hook.toml +++ b/.rusty-hook.toml @@ -1,3 +1,2 @@ [hooks] pre-push = "cargo run --bin cargo-make -- make ci-flow" - diff --git a/Cargo.toml b/Cargo.toml index 30a1add3..44198dd1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,18 +10,24 @@ homepage = "https://sagiegurari.github.io/cargo-make" repository = "https://github.com/sagiegurari/cargo-make.git" readme = "README.md" keywords = ["task", "build", "cargo", "plugin", "subcommand"] -categories = ["command-line-utilities", "development-tools", "development-tools::cargo-plugins", "development-tools::build-utils", "development-tools::testing"] +categories = [ + "command-line-utilities", + "development-tools", + "development-tools::cargo-plugins", + "development-tools::build-utils", + "development-tools::testing", +] include = [ - "/benches/*", - "/docs/*", - "/examples/*", - "/src/*", - "/tests/*", - "/Cargo.toml", - "/LICENSE", - "/README.md", - "/CHANGELOG.md", - "/Makefile.toml" + "/benches/*", + "/docs/*", + "/examples/*", + "/src/*", + "/tests/*", + "/Cargo.toml", + "/LICENSE", + "/README.md", + "/CHANGELOG.md", + "/Makefile.toml", ] [lib] diff --git a/Makefile.toml b/Makefile.toml index c4ff957b..2ae26d98 100755 --- a/Makefile.toml +++ b/Makefile.toml @@ -1,18 +1,19 @@ [config] additional_profiles = [ - "multi-phase-tests", - "ci-coverage-tasks", - "ci-static-code-analysis-tasks", - "ci-all-build-tasks", - "publish-pre-cleanup" + "all-default-tasks", + "multi-phase-tests", + "ci-coverage-tasks", + "ci-static-code-analysis-tasks", + "ci-all-build-tasks", + "publish-pre-cleanup", ] [env] CARGO_MAKE_TEST_COVERAGE_BINARY_FILTER = "cli-[a-z0-9]*$\\|makers-[a-z0-9]*$\\|${CARGO_MAKE_TEST_COVERAGE_DEFAULT_BINARY_FILTER}" CARGO_MAKE_TEMP_UNSTABLE_KEY = "${CARGO_MAKE_RUST_TARGET_OS}-${CARGO_MAKE_RUST_CHANNEL}-${CARGO_MAKE_CI}" -CARGO_MAKE_TEMP_UNSTABLE_TEST_ENV = { source = "${CARGO_MAKE_TEMP_UNSTABLE_KEY}", default_value = "false", mapping = {"none" = "true"} } -CARGO_MAKE_TEMP_UNSTABLE_FMT_ENV = { source = "${CARGO_MAKE_TEMP_UNSTABLE_KEY}", default_value = "false", mapping = {"windows-stable-true" = "true", "windows-beta-true" = "true", "windows-nightly-true" = "true", "linux-nightly-true" = "true"} } +CARGO_MAKE_TEMP_UNSTABLE_TEST_ENV = { source = "${CARGO_MAKE_TEMP_UNSTABLE_KEY}", default_value = "false", mapping = { "none" = "true" } } +CARGO_MAKE_TEMP_UNSTABLE_FMT_ENV = { source = "${CARGO_MAKE_TEMP_UNSTABLE_KEY}", default_value = "false", mapping = { "windows-stable-true" = "true", "windows-beta-true" = "true", "windows-nightly-true" = "true", "linux-nightly-true" = "true" } } [tasks.post-print-env] category = "Tools" @@ -71,11 +72,11 @@ args = [ "--output-file", "${CARGO_MAKE_WORKING_DIRECTORY}/docs/cargo_make_task_list.md", "--makefile", - "${CARGO_MAKE_WORKING_DIRECTORY}/src/lib/test/makefiles/empty.toml" + "${CARGO_MAKE_WORKING_DIRECTORY}/src/lib/test/makefiles/empty.toml", ] [tasks.generate-docs] -condition = { env_false = [ "CARGO_MAKE_CI" ], platforms = [ "linux" ] } +condition = { env_false = ["CARGO_MAKE_CI"], platforms = ["linux"] } run_task = { name = ["generate-readme", "generate-task-list"] } [tasks.post-docs] diff --git a/examples/alias.toml b/examples/alias.toml index 00ae6ac4..efc06290 100755 --- a/examples/alias.toml +++ b/examples/alias.toml @@ -12,4 +12,4 @@ dependencies = ["D2"] script = "echo hello" [tasks.D2] -alias="D" +alias = "D" diff --git a/examples/clear.toml b/examples/clear.toml index a7f099b1..bccf0703 100644 --- a/examples/clear.toml +++ b/examples/clear.toml @@ -3,6 +3,4 @@ extend = "script.toml" [tasks.hello-world] clear = true command = "echo" -args = [ - "extended hello world" -] +args = ["extended hello world"] diff --git a/examples/condition.toml b/examples/condition.toml index 897bf87c..535f183b 100755 --- a/examples/condition.toml +++ b/examples/condition.toml @@ -33,10 +33,10 @@ args = ["running test-default"] [tasks.test-routing] run_task = [ - { name = "test1", condition = { platforms = ["windows", "linux"], channels = ["beta", "stable"] } }, - { name = "test2", condition = { platforms = ["mac"], rust_version = { min = "1.20.0", max = "1.30.0" } } }, - { name = "test3", condition_script = [ "somecommand" ] }, - { name = "test-default" } + { name = "test1", condition = { platforms = ["windows", "linux"], channels = ["beta", "stable"] } }, + { name = "test2", condition = { platforms = ["mac"], rust_version = { min = "1.20.0", max = "1.30.0" } } }, + { name = "test3", condition_script = ["somecommand"] }, + { name = "test-default" }, ] [tasks.test-true-condition] @@ -64,9 +64,7 @@ echo "condition was met" ''' [tasks.test-condition-script] -condition_script = [ - "exit 1" -] +condition_script = ["exit 1"] command = "echo" args = ["condition was met"] @@ -77,8 +75,6 @@ args = ["condition was met"] [tasks.test-condition-script-with-message] condition = { fail_message = "Condition Script Failed." } -condition_script = [ - "exit 1" -] +condition_script = ["exit 1"] command = "echo" args = ["condition was met"] diff --git a/examples/cross_platform_shell.toml b/examples/cross_platform_shell.toml index 52f22b41..acb35fa7 100755 --- a/examples/cross_platform_shell.toml +++ b/examples/cross_platform_shell.toml @@ -4,4 +4,3 @@ script_runner = "@shell" script = ''' rm ./myfile.txt ''' - diff --git a/examples/cwd.toml b/examples/cwd.toml index 36a9c35a..2fa8bd5b 100755 --- a/examples/cwd.toml +++ b/examples/cwd.toml @@ -8,10 +8,7 @@ echo CARGO_MAKE_CURRENT_TASK_INITIAL_MAKEFILE_DIRECTORY: ${CARGO_MAKE_CURRENT_TA [tasks.cwd] command = "pwd" -condition_script = [ - "echo pwd during condition:", - "pwd" -] +condition_script = ["echo pwd during condition:", "pwd"] install_script = ''' echo pwd during installation: pwd @@ -20,10 +17,7 @@ pwd [tasks.change-cwd] command = "pwd" cwd = "./examples/files" -condition_script = [ - "echo pwd during condition:", - "pwd" -] +condition_script = ["echo pwd during condition:", "pwd"] install_script = ''' echo pwd during installation: pwd @@ -32,10 +26,7 @@ pwd [tasks.makefile-cwd] command = "pwd" cwd = "${CARGO_MAKE_CURRENT_TASK_INITIAL_MAKEFILE_DIRECTORY}" -condition_script = [ - "echo pwd during condition:", - "pwd" -] +condition_script = ["echo pwd during condition:", "pwd"] install_script = ''' echo pwd during installation: pwd diff --git a/examples/duckscript.toml b/examples/duckscript.toml index e454bc7f..fc76638f 100644 --- a/examples/duckscript.toml +++ b/examples/duckscript.toml @@ -52,4 +52,3 @@ script = ''' #!@duckscript sleep 1000 ''' - diff --git a/examples/env.toml b/examples/env.toml index be88fc26..0934e308 100755 --- a/examples/env.toml +++ b/examples/env.toml @@ -1,11 +1,8 @@ -env_files = [ - { path = "./profile.env", profile = "development" }, - { path = "./test.env" } -] +env_files = [{ path = "./profile.env", profile = "development" }, { path = "./test.env" }] env_scripts = [ -''' + ''' #!@duckscript echo first env script... @@ -14,13 +11,13 @@ echo COMPOSITE = ${composite_env_value} set_env COMPOSITE_2 ${composite_env_value} ''', -''' + ''' #!@duckscript echo second env script... composite_env_value = get_env COMPOSITE_2 echo COMPOSITE_2 = ${composite_env_value} -''' +''', ] [config] @@ -33,11 +30,15 @@ COMPOSITE = "simple value: ${SIMPLE} script value: ${SCRIPT}" ECHO_CMD = "echo" MULTI_LINE_SCRIPT = { script = ["echo 1\necho 2"], multi_line = true } BOOL_VALUE = true -LIBRARY_EXTENSION = { source = "${CARGO_MAKE_RUST_TARGET_OS}", default_value = "unknown", mapping = {"linux" = "so", "macos" = "dylib", "windows" = "dll", "openbsd" = "so" } } +LIBRARY_EXTENSION = { source = "${CARGO_MAKE_RUST_TARGET_OS}", default_value = "unknown", mapping = { "linux" = "so", "macos" = "dylib", "windows" = "dll", "openbsd" = "so" } } TO_UNSET = { unset = true } PREFER_EXISTING = "original" OVERWRITE_EXISTING = "original" -ENV_FROM_LIST = ["ARG1", "${SIMPLE}", "simple value: ${SIMPLE} script value: ${SCRIPT}"] +ENV_FROM_LIST = [ + "ARG1", + "${SIMPLE}", + "simple value: ${SIMPLE} script value: ${SCRIPT}", +] CONDITIONED_VALUE = { value = "${SIMPLE}", condition = { env_set = ["SIMPLE"] } } [env.override-test] @@ -64,7 +65,7 @@ echo git branch: ${CARGO_MAKE_GIT_BRANCH} ''' [tasks.wrapper] -condition = { env_not_set = [ "SKIP_TASK" ] } +condition = { env_not_set = ["SKIP_TASK"] } run_task = "echo" [tasks.test-flow] @@ -93,9 +94,7 @@ env = { "IS_LINUX" = "YAP" } [tasks.expand] command = "${ECHO_CMD}" -args = [ - "VALUE: ${SIMPLE}" -] +args = ["VALUE: ${SIMPLE}"] [tasks.multi-line] script = ''' diff --git a/examples/extending.toml b/examples/extending.toml index efddd879..0c140bba 100755 --- a/examples/extending.toml +++ b/examples/extending.toml @@ -2,4 +2,4 @@ extend = "alias.toml" [tasks.extended] -alias="D2" +alias = "D2" diff --git a/examples/extends_list.toml b/examples/extends_list.toml index b2bec244..b5889bef 100755 --- a/examples/extends_list.toml +++ b/examples/extends_list.toml @@ -1,5 +1,9 @@ -extend = [ { path = "alias.toml" }, { path = "optional_makefile.toml", optional = true }, { path = "cwd.toml" } ] +extend = [ + { path = "alias.toml" }, + { path = "optional_makefile.toml", optional = true }, + { path = "cwd.toml" }, +] [tasks.extended] -alias="D2" +alias = "D2" diff --git a/examples/extends_not_found.toml b/examples/extends_not_found.toml index e4ca3d54..c8244fc3 100755 --- a/examples/extends_not_found.toml +++ b/examples/extends_not_found.toml @@ -2,4 +2,4 @@ extend = "bad.toml" [tasks.extended] -alias="D2" +alias = "D2" diff --git a/examples/extends_optional_not_found.toml b/examples/extends_optional_not_found.toml index f3bba9eb..1e62a059 100755 --- a/examples/extends_optional_not_found.toml +++ b/examples/extends_optional_not_found.toml @@ -2,4 +2,4 @@ extend = { path = "does_not_exist_makefile.toml", optional = true } [tasks.extended] -alias="D2" +alias = "D2" diff --git a/examples/files/extending.toml b/examples/files/extending.toml index ab37223d..2573f700 100755 --- a/examples/files/extending.toml +++ b/examples/files/extending.toml @@ -5,4 +5,4 @@ extend = "../extending.toml" init_task = "test_init" [tasks.extended2] -alias="extended" +alias = "extended" diff --git a/examples/functions.toml b/examples/functions.toml index 90d6878b..91ac4f04 100644 --- a/examples/functions.toml +++ b/examples/functions.toml @@ -44,12 +44,27 @@ args = ["clippy", "@@split(CARGO_MAKE_CLIPPY_ARGS, )"] [tasks.decode] command = "echo" -args = ["Env:", "${DECODE_ENV_VAR}", "Decoded:", "@@decode(DECODE_ENV_VAR,development,dev,ci,test)"] +args = [ + "Env:", + "${DECODE_ENV_VAR}", + "Decoded:", + "@@decode(DECODE_ENV_VAR,development,dev,ci,test)", +] [tasks.decode-with-default] command = "echo" -args = ["Env:", "${DECODE_ENV_VAR}", "Decoded:", "@@decode(DECODE_ENV_VAR,development,dev,ci,test,unknown)"] +args = [ + "Env:", + "${DECODE_ENV_VAR}", + "Decoded:", + "@@decode(DECODE_ENV_VAR,development,dev,ci,test,unknown)", +] [tasks.decode-with-eval] command = "echo" -args = ["Env:", "${DECODE_ENV_VAR}", "Decoded:", "@@decode(DECODE_ENV_VAR,test,The current profile is: ${CARGO_MAKE_PROFILE})"] +args = [ + "Env:", + "${DECODE_ENV_VAR}", + "Decoded:", + "@@decode(DECODE_ENV_VAR,test,The current profile is: ${CARGO_MAKE_PROFILE})", +] diff --git a/examples/javascript.toml b/examples/javascript.toml index d45ac8dd..e399d901 100644 --- a/examples/javascript.toml +++ b/examples/javascript.toml @@ -4,4 +4,3 @@ script_extension = "js" script = ''' console.log('Hello, World!'); ''' - diff --git a/examples/perl.toml b/examples/perl.toml index 4b42af7c..a8eecd30 100644 --- a/examples/perl.toml +++ b/examples/perl.toml @@ -4,4 +4,3 @@ script_extension = "pl" script = ''' print "Hello, World!\n"; ''' - diff --git a/examples/php.toml b/examples/php.toml index a7cb2e2b..1e3bd039 100644 --- a/examples/php.toml +++ b/examples/php.toml @@ -14,4 +14,3 @@ script = '''