From 5896f5b102da7f7fbb42afcaee04ad73c38586ab Mon Sep 17 00:00:00 2001 From: UrsKahmann Date: Tue, 31 Mar 2020 12:27:09 +0200 Subject: [PATCH 01/17] added danger xode warnings --- commons/smf_danger/Dangerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/commons/smf_danger/Dangerfile b/commons/smf_danger/Dangerfile index 8f9f4b93..201ddaa0 100644 --- a/commons/smf_danger/Dangerfile +++ b/commons/smf_danger/Dangerfile @@ -80,3 +80,5 @@ else message(ticket_message) end + +xcode_summary.report 'xcodebuild.json' From d2deca0e9975d6f87935b8f038e4aaa7838047aa Mon Sep 17 00:00:00 2001 From: UrsKahmann Date: Tue, 31 Mar 2020 12:44:07 +0200 Subject: [PATCH 02/17] chnaged path --- commons/smf_danger/Dangerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commons/smf_danger/Dangerfile b/commons/smf_danger/Dangerfile index 201ddaa0..73708a65 100644 --- a/commons/smf_danger/Dangerfile +++ b/commons/smf_danger/Dangerfile @@ -81,4 +81,4 @@ else message(ticket_message) end -xcode_summary.report 'xcodebuild.json' +xcode_summary.report 'build/errors.json' From ef3aa4fd8ce5fc52f1b80c2c805ddc49c4875d31 Mon Sep 17 00:00:00 2001 From: UrsKahmann Date: Tue, 31 Mar 2020 12:48:50 +0200 Subject: [PATCH 03/17] fixed path --- commons/smf_danger/Dangerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commons/smf_danger/Dangerfile b/commons/smf_danger/Dangerfile index 73708a65..1b37bef3 100644 --- a/commons/smf_danger/Dangerfile +++ b/commons/smf_danger/Dangerfile @@ -81,4 +81,4 @@ else message(ticket_message) end -xcode_summary.report 'build/errors.json' +xcode_summary.report 'build/reports/errors.json' From e63a7cec47e047998d3eab751000e22def27c752 Mon Sep 17 00:00:00 2001 From: UrsKahmann Date: Tue, 31 Mar 2020 14:12:44 +0200 Subject: [PATCH 04/17] testing inline mode --- commons/smf_danger/Dangerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/commons/smf_danger/Dangerfile b/commons/smf_danger/Dangerfile index 1b37bef3..ee2c4c02 100644 --- a/commons/smf_danger/Dangerfile +++ b/commons/smf_danger/Dangerfile @@ -81,4 +81,5 @@ else message(ticket_message) end +xcode_summary.inline_mode = true xcode_summary.report 'build/reports/errors.json' From f1ed03d65caf054e1f18cbfd940d236cefc49986 Mon Sep 17 00:00:00 2001 From: UrsKahmann Date: Wed, 1 Apr 2020 09:58:13 +0200 Subject: [PATCH 05/17] debugging --- commons/smf_danger/Dangerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/commons/smf_danger/Dangerfile b/commons/smf_danger/Dangerfile index ee2c4c02..8d9cea96 100644 --- a/commons/smf_danger/Dangerfile +++ b/commons/smf_danger/Dangerfile @@ -83,3 +83,5 @@ end xcode_summary.inline_mode = true xcode_summary.report 'build/reports/errors.json' + +warn("This is an inline test message test", file: "AppDelegate.swift", line: 27) From 788f9c0982febe2f9ec3cb311cd2a1b620fb7753 Mon Sep 17 00:00:00 2001 From: UrsKahmann Date: Wed, 1 Apr 2020 10:04:18 +0200 Subject: [PATCH 06/17] debugging --- commons/smf_danger/Dangerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commons/smf_danger/Dangerfile b/commons/smf_danger/Dangerfile index 8d9cea96..857675e2 100644 --- a/commons/smf_danger/Dangerfile +++ b/commons/smf_danger/Dangerfile @@ -84,4 +84,4 @@ end xcode_summary.inline_mode = true xcode_summary.report 'build/reports/errors.json' -warn("This is an inline test message test", file: "AppDelegate.swift", line: 27) +warn("This is an inline test message test", file: "AppDelegate.swift", line: 28) From b86c0e8534321dfa8b6586cee30f396783f20db6 Mon Sep 17 00:00:00 2001 From: UrsKahmann Date: Wed, 1 Apr 2020 10:10:29 +0200 Subject: [PATCH 07/17] debugging --- commons/smf_danger/Dangerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commons/smf_danger/Dangerfile b/commons/smf_danger/Dangerfile index 857675e2..bf774ad8 100644 --- a/commons/smf_danger/Dangerfile +++ b/commons/smf_danger/Dangerfile @@ -84,4 +84,4 @@ end xcode_summary.inline_mode = true xcode_summary.report 'build/reports/errors.json' -warn("This is an inline test message test", file: "AppDelegate.swift", line: 28) +warn("This is an inline test message test", file: "App/Shared/AppDelegate.swift", line: 28) From e5229f7c086d2dab2531f36428b14a56d4a68e5c Mon Sep 17 00:00:00 2001 From: UrsKahmann Date: Wed, 1 Apr 2020 10:17:59 +0200 Subject: [PATCH 08/17] debugging --- commons/smf_danger/Dangerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commons/smf_danger/Dangerfile b/commons/smf_danger/Dangerfile index bf774ad8..3bd49e4d 100644 --- a/commons/smf_danger/Dangerfile +++ b/commons/smf_danger/Dangerfile @@ -84,4 +84,4 @@ end xcode_summary.inline_mode = true xcode_summary.report 'build/reports/errors.json' -warn("This is an inline test message test", file: "App/Shared/AppDelegate.swift", line: 28) +warn("This is an new inline test message test", file: "/Users/smf/nodeMasterJenkins/workspace/unds_CI_iOS_App_Playground_PR-72/App/Shared/AppDelegate.swift", line: 27) From f9b6889e6e918097bcdae08bde54166078c7c3d4 Mon Sep 17 00:00:00 2001 From: UrsKahmann Date: Wed, 1 Apr 2020 11:24:35 +0200 Subject: [PATCH 09/17] debugging --- commons/smf_danger/Dangerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/commons/smf_danger/Dangerfile b/commons/smf_danger/Dangerfile index 3bd49e4d..3cfe6455 100644 --- a/commons/smf_danger/Dangerfile +++ b/commons/smf_danger/Dangerfile @@ -82,6 +82,5 @@ else end xcode_summary.inline_mode = true +xcode_summary.ignored_files = '*[^.swift]' xcode_summary.report 'build/reports/errors.json' - -warn("This is an new inline test message test", file: "/Users/smf/nodeMasterJenkins/workspace/unds_CI_iOS_App_Playground_PR-72/App/Shared/AppDelegate.swift", line: 27) From b55781e05a7b4ce88a7842ca0ac746ce07a81567 Mon Sep 17 00:00:00 2001 From: UrsKahmann Date: Wed, 1 Apr 2020 11:47:50 +0200 Subject: [PATCH 10/17] debugging --- commons/smf_danger/Dangerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/commons/smf_danger/Dangerfile b/commons/smf_danger/Dangerfile index 3cfe6455..841975da 100644 --- a/commons/smf_danger/Dangerfile +++ b/commons/smf_danger/Dangerfile @@ -82,5 +82,7 @@ else end xcode_summary.inline_mode = true -xcode_summary.ignored_files = '*[^.swift]' +xcode_summary.ignored_results { |result| + result.scan(/.*\.swift.*/).isEmpty? +} xcode_summary.report 'build/reports/errors.json' From bb7d710775f31ae5f1b58e9b8d4ebb5dd2fc38e4 Mon Sep 17 00:00:00 2001 From: UrsKahmann Date: Wed, 1 Apr 2020 11:55:02 +0200 Subject: [PATCH 11/17] debugging --- commons/smf_danger/Dangerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/commons/smf_danger/Dangerfile b/commons/smf_danger/Dangerfile index 841975da..a1b4205a 100644 --- a/commons/smf_danger/Dangerfile +++ b/commons/smf_danger/Dangerfile @@ -83,6 +83,7 @@ end xcode_summary.inline_mode = true xcode_summary.ignored_results { |result| - result.scan(/.*\.swift.*/).isEmpty? + return File.fnmatch('*[^.swift]*', result.location.file_path) unless result.location.nil? + result.message.scan(/.*\.swift.*/).isEmpty? } xcode_summary.report 'build/reports/errors.json' From 8f83a1c43de54ec2fed050fe0aa9de5fcbcdff94 Mon Sep 17 00:00:00 2001 From: UrsKahmann Date: Wed, 1 Apr 2020 12:00:24 +0200 Subject: [PATCH 12/17] debugging --- commons/smf_danger/Dangerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commons/smf_danger/Dangerfile b/commons/smf_danger/Dangerfile index a1b4205a..48f573c2 100644 --- a/commons/smf_danger/Dangerfile +++ b/commons/smf_danger/Dangerfile @@ -84,6 +84,6 @@ end xcode_summary.inline_mode = true xcode_summary.ignored_results { |result| return File.fnmatch('*[^.swift]*', result.location.file_path) unless result.location.nil? - result.message.scan(/.*\.swift.*/).isEmpty? + result.message.scan(/.*\.swift.*/).empty? } xcode_summary.report 'build/reports/errors.json' From 6575b485745607dc1e4e06e2b56133d7a1b5e047 Mon Sep 17 00:00:00 2001 From: UrsKahmann Date: Wed, 1 Apr 2020 12:06:32 +0200 Subject: [PATCH 13/17] debugging --- commons/smf_danger/Dangerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/commons/smf_danger/Dangerfile b/commons/smf_danger/Dangerfile index 48f573c2..ea1868bf 100644 --- a/commons/smf_danger/Dangerfile +++ b/commons/smf_danger/Dangerfile @@ -83,7 +83,10 @@ end xcode_summary.inline_mode = true xcode_summary.ignored_results { |result| + puts("Path is: #{result.location.file_path} and matches: #{File.fnmatch('*[^.swift]*', result.location.file_path)}") unless result.location.nil? return File.fnmatch('*[^.swift]*', result.location.file_path) unless result.location.nil? + + puts("Messaeg is: #{result.message} and macthes: #{result.message.scan(/.*\.swift.*/).empty?}") result.message.scan(/.*\.swift.*/).empty? } xcode_summary.report 'build/reports/errors.json' From 6ef30af2956bab45f66996f028235bf34231bd63 Mon Sep 17 00:00:00 2001 From: UrsKahmann Date: Wed, 1 Apr 2020 12:11:35 +0200 Subject: [PATCH 14/17] debugging --- commons/smf_danger/Dangerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commons/smf_danger/Dangerfile b/commons/smf_danger/Dangerfile index ea1868bf..2048d417 100644 --- a/commons/smf_danger/Dangerfile +++ b/commons/smf_danger/Dangerfile @@ -84,7 +84,7 @@ end xcode_summary.inline_mode = true xcode_summary.ignored_results { |result| puts("Path is: #{result.location.file_path} and matches: #{File.fnmatch('*[^.swift]*', result.location.file_path)}") unless result.location.nil? - return File.fnmatch('*[^.swift]*', result.location.file_path) unless result.location.nil? + return File.fnmatch('*[^.swift]', result.location.file_path) unless result.location.nil? puts("Messaeg is: #{result.message} and macthes: #{result.message.scan(/.*\.swift.*/).empty?}") result.message.scan(/.*\.swift.*/).empty? From 5cbf2b737a76b74604f57dcadd6855e5d9fe0138 Mon Sep 17 00:00:00 2001 From: UrsKahmann Date: Wed, 1 Apr 2020 12:18:07 +0200 Subject: [PATCH 15/17] debugging --- commons/smf_danger/Dangerfile | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/commons/smf_danger/Dangerfile b/commons/smf_danger/Dangerfile index 2048d417..1fe50352 100644 --- a/commons/smf_danger/Dangerfile +++ b/commons/smf_danger/Dangerfile @@ -81,12 +81,18 @@ else message(ticket_message) end +## XCODE WARNINGS xcode_summary.inline_mode = true +xcode_summary.ignored_files = 'Pods/**' + xcode_summary.ignored_results { |result| - puts("Path is: #{result.location.file_path} and matches: #{File.fnmatch('*[^.swift]*', result.location.file_path)}") unless result.location.nil? - return File.fnmatch('*[^.swift]', result.location.file_path) unless result.location.nil? - puts("Messaeg is: #{result.message} and macthes: #{result.message.scan(/.*\.swift.*/).empty?}") - result.message.scan(/.*\.swift.*/).empty? + if result.location.nil? + puts("Message is: #{result.message} and macthes: #{result.message.scan(/.*\.swift.*/).empty?}") + result.message.scan(/.*\.swift.*/).empty? + else + puts("Path is: #{result.location.file_path} and matches: #{File.fnmatch('*[^.swift]', result.location.file_path)}") + File.fnmatch('*[^.swift]', result.location.file_path) + end } xcode_summary.report 'build/reports/errors.json' From 688e413b955ecfaffd97356211d941bee419c69c Mon Sep 17 00:00:00 2001 From: UrsKahmann Date: Wed, 1 Apr 2020 12:21:55 +0200 Subject: [PATCH 16/17] removed debug prints --- commons/smf_danger/Dangerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/commons/smf_danger/Dangerfile b/commons/smf_danger/Dangerfile index 1fe50352..4ff2e7a9 100644 --- a/commons/smf_danger/Dangerfile +++ b/commons/smf_danger/Dangerfile @@ -88,11 +88,10 @@ xcode_summary.ignored_files = 'Pods/**' xcode_summary.ignored_results { |result| if result.location.nil? - puts("Message is: #{result.message} and macthes: #{result.message.scan(/.*\.swift.*/).empty?}") result.message.scan(/.*\.swift.*/).empty? else - puts("Path is: #{result.location.file_path} and matches: #{File.fnmatch('*[^.swift]', result.location.file_path)}") File.fnmatch('*[^.swift]', result.location.file_path) end } + xcode_summary.report 'build/reports/errors.json' From 74ffaf530d1fc9e8c60e8b44b87e1ea1efa4451e Mon Sep 17 00:00:00 2001 From: UrsKahmann Date: Tue, 7 Apr 2020 15:48:53 +0200 Subject: [PATCH 17/17] Checking if errors.json exists, before running xocde_summary.report --- commons/smf_danger/Dangerfile | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/commons/smf_danger/Dangerfile b/commons/smf_danger/Dangerfile index 4ff2e7a9..1c18c23f 100644 --- a/commons/smf_danger/Dangerfile +++ b/commons/smf_danger/Dangerfile @@ -82,16 +82,19 @@ else end ## XCODE WARNINGS -xcode_summary.inline_mode = true -xcode_summary.ignored_files = 'Pods/**' -xcode_summary.ignored_results { |result| +if File.exist?('build/reports/errors.json') + xcode_summary.inline_mode = true + xcode_summary.ignored_files = 'Pods/**' - if result.location.nil? - result.message.scan(/.*\.swift.*/).empty? - else - File.fnmatch('*[^.swift]', result.location.file_path) - end -} + xcode_summary.ignored_results { |result| -xcode_summary.report 'build/reports/errors.json' + if result.location.nil? + result.message.scan(/.*\.swift.*/).empty? + else + File.fnmatch('*[^.swift]', result.location.file_path) + end + } + + xcode_summary.report 'build/reports/errors.json' +end