From ec934ba3c0f06870da50f3408dc09e7e8c9b00e3 Mon Sep 17 00:00:00 2001 From: Andrey Nering Date: Sat, 7 Dec 2019 19:48:25 -0300 Subject: [PATCH 1/3] .editorconfig: Remove "indent_size" This way, everyone can configure use their preferred tab size. Closes #269 Co-authored-by: Nick Klauer --- .editorconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/.editorconfig b/.editorconfig index f60a8b79..4ab2eb30 100644 --- a/.editorconfig +++ b/.editorconfig @@ -7,7 +7,6 @@ insert_final_newline = true charset = utf-8 trim_trailing_whitespace = true indent_style = tab -indent_size = 8 [*.{md,yml,yaml,json,toml,htm,html}] indent_style = space From 4bdfe64afb6cf96c4daa1faacf06b036864506e7 Mon Sep 17 00:00:00 2001 From: Andrey Nering Date: Sat, 7 Dec 2019 21:44:09 -0300 Subject: [PATCH 2/3] Add hability silent all tasks By add `silent: true` at the root of the Taskfile. --- CHANGELOG.md | 2 ++ Taskfile.yml | 2 ++ docs/styleguide.md | 2 +- docs/usage.md | 15 ++++++++++++++- internal/taskfile/taskfile.go | 3 +++ task.go | 2 +- 6 files changed, 23 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b0170058..a66b1931 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ ([#266](https://github.com/go-task/task/pull/266)). - Fixed bug where calling the `task` CLI only informing global vars would not execute the `default` task. +- Add hability to silent all tasks by adding `silent: true` a the root of the + Taskfile. ## v2.7.1 - 2019-11-10 diff --git a/Taskfile.yml b/Taskfile.yml index c85fd0ff..dee88d4c 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -1,5 +1,7 @@ version: '2' +# silent: true + includes: docs: ./docs diff --git a/docs/styleguide.md b/docs/styleguide.md index 59933bf1..096c5868 100644 --- a/docs/styleguide.md +++ b/docs/styleguide.md @@ -28,7 +28,7 @@ officially supported. On Linux, only `Taskfile.yml` will work, though. - `version:` - `includes:` -- Configuration ones, like `output:` and `expansions:` +- Configuration ones, like `output:`, `expansions:` or `silent:` - `vars:` - `env:` - `tasks:` diff --git a/docs/usage.md b/docs/usage.md index 5e139823..8743c295 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -674,7 +674,7 @@ With silent mode on, the below will be print instead: Print something ``` -There's three ways to enable silent mode: +There are four ways to enable silent mode: * At command level: @@ -700,6 +700,19 @@ tasks: silent: true ``` +* Globally at Taskfile level: + +```yaml +version: '2' + +silent: true + +tasks: + echo: + cmds: + - echo "Print something" +``` + * Or globally with `--silent` or `-s` flag If you want to suppress STDOUT instead, just redirect a command to `/dev/null`: diff --git a/internal/taskfile/taskfile.go b/internal/taskfile/taskfile.go index 6da09dd0..3fbda37d 100644 --- a/internal/taskfile/taskfile.go +++ b/internal/taskfile/taskfile.go @@ -9,6 +9,7 @@ type Taskfile struct { Vars Vars Env Vars Tasks Tasks + Silent bool } // UnmarshalYAML implements yaml.Unmarshaler interface @@ -26,6 +27,7 @@ func (tf *Taskfile) UnmarshalYAML(unmarshal func(interface{}) error) error { Vars Vars Env Vars Tasks Tasks + Silent bool } if err := unmarshal(&taskfile); err != nil { return err @@ -37,6 +39,7 @@ func (tf *Taskfile) UnmarshalYAML(unmarshal func(interface{}) error) error { tf.Vars = taskfile.Vars tf.Env = taskfile.Env tf.Tasks = taskfile.Tasks + tf.Silent = taskfile.Silent if tf.Expansions <= 0 { tf.Expansions = 2 } diff --git a/task.go b/task.go index 1c3cd383..067d7229 100644 --- a/task.go +++ b/task.go @@ -308,7 +308,7 @@ func (e *Executor) runCommand(ctx context.Context, t *taskfile.Task, call taskfi } return nil case cmd.Cmd != "": - if e.Verbose || (!cmd.Silent && !t.Silent && !e.Silent) { + if e.Verbose || (!cmd.Silent && !t.Silent && !e.Taskfile.Silent && !e.Silent) { e.Logger.Errf(cmd.Cmd) } From 01e9a8f72017fb7a4f5b41ed5a2792247c2c9aca Mon Sep 17 00:00:00 2001 From: Andrey Nering Date: Sat, 7 Dec 2019 21:54:10 -0300 Subject: [PATCH 3/3] v2.8.0 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a66b1931..1ef0e30c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## Unreleased +## v2.8.0 - 2019-12-07 - Add `--parallel` flag (alias `-p`) to run tasks given by the command line in parallel