Esempio n. 1
0
                public override void Result(InvokeResult result)
                {
                    var records = result.AsRecord();

                    for (var i = 0; i < records.Length; i++)
                    {
                        if (i == 0)
                        {
                            Write();
                            Write(StartObject(records[i]));
                            _WasInfo = true;
                        }
                        if (_WasInfo)
                        {
                            Write();
                        }
                        _WasInfo = false;

                        if (records[i].IsSuccess())
                        {
                            Write(string.Concat("    [+] ", records[i].RuleName));
                        }
                        else
                        {
                            Write(string.Concat("    [-] ", records[i].RuleName));
                            Error(string.Format(FormatterStrings.GitHubActions_Fail, records[i].TargetName, records[i].RuleName, GetReason(records[i])));
                        }
                    }
                }
Esempio n. 2
0
                public override void Result(InvokeResult result)
                {
                    var records = result.AsRecord();

                    for (var i = 0; i < records.Length; i++)
                    {
                        if (i == 0)
                        {
                            Empty();
                            Green(StartObject(records[i]));
                            Empty();
                        }

                        if (records[i].IsSuccess())
                        {
                            Green(string.Format(FormatterStrings.Client_Pass, records[i].RuleName));
                        }
                        else if (records[i].Outcome == RuleOutcome.Error)
                        {
                            Red(string.Format(FormatterStrings.Client_Error, records[i].RuleName));
                        }
                        else
                        {
                            Red(string.Format(FormatterStrings.Client_Fail, records[i].RuleName));
                        }
                    }
                }
Esempio n. 3
0
                public void Result(InvokeResult result)
                {
                    var records = result.AsRecord();

                    for (var i = 0; i < records.Length; i++)
                    {
                        if (i == 0)
                        {
                            _Logger.WriteObject(string.Empty, false);
                            _Logger.WriteObject(string.Concat(" -> ", records[i].TargetName, " : ", records[i].TargetType), false);
                            _Logger.WriteObject(string.Empty, false);
                        }

                        if (records[i].IsSuccess())
                        {
                            _Logger.WriteObject(string.Concat("    [+] ", records[i].RuleName), false);
                        }
                        else
                        {
                            _Logger.WriteObject(string.Concat("    [-] ", records[i].RuleName), false);
                            _Logger.WriteObject(string.Empty, false);
                            _Logger.WriteObject(string.Concat("::error:: ", records[i].TargetName, " [FAIL] ", records[i].RuleName), false);
                            Reason(records[i]);
                            if (i + 1 < records.Length)
                            {
                                _Logger.WriteObject(string.Empty, false);
                            }
                        }
                    }
                }
Esempio n. 4
0
 private void ProcessResult(InvokeResult result)
 {
     _Formatter.Result(result);
     _FailCount  += result.Fail;
     _ErrorCount += result.Error;
     _TotalCount += result.Total;
     if (_Results != null)
     {
         _Results.AddRange(result.AsRecord());
     }
 }
Esempio n. 5
0
                protected void StartObject(InvokeResult result, out RuleRecord[] records, ConsoleColor?forgroundColor = null)
                {
                    records = result.AsRecord();
                    if (records == null || records.Length == 0)
                    {
                        return;
                    }

                    BreakIfUnbrokenContent();
                    BreakIfUnbrokenInfo();
                    WriteLine(string.Concat(" -> ", records[0].TargetName, " : ", records[0].TargetType), forgroundColor: forgroundColor);
                    LineBreak();
                }
Esempio n. 6
0
                public override void Result(InvokeResult result)
                {
                    var records = result.AsRecord();

                    for (var i = 0; i < records.Length; i++)
                    {
                        if (i == 0)
                        {
                            Write();
                            Write(StartObject(records[i]));
                            Write();
                        }

                        if (records[i].IsSuccess())
                        {
                            Write(string.Format(FormatterStrings.Plain_Pass, records[i].RuleName));
                        }
                        else
                        {
                            Write(string.Format(FormatterStrings.Plain_Fail, records[i].RuleName));
                        }
                    }
                }
Esempio n. 7
0
                public void Result(InvokeResult result)
                {
                    var records = result.AsRecord();

                    for (var i = 0; i < records.Length; i++)
                    {
                        if (i == 0)
                        {
                            Empty();
                            Green(string.Concat(" -> ", records[i].TargetName, " : ", records[i].TargetType));
                            Empty();
                        }

                        if (records[i].IsSuccess())
                        {
                            Green(string.Concat("    [PASS] ", records[i].RuleName));
                        }
                        else
                        {
                            Red(string.Concat("    [FAIL] ", records[i].RuleName));
                        }
                    }
                }