diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-05 12:08:10 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-05 12:08:10 +0300 |
commit | 190ca0529dd0edef1d881e09d5352f83426b01d3 (patch) | |
tree | 1ccf0772ae09175a5846ae5d2b462dc205c4ddf6 /scripts/static-analysis | |
parent | d513f3fb25d39ab74e1046fb8be94408b3c84414 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'scripts/static-analysis')
-rwxr-xr-x | scripts/static-analysis | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/scripts/static-analysis b/scripts/static-analysis index 1392a4f6a23..c26c9a55bb1 100755 --- a/scripts/static-analysis +++ b/scripts/static-analysis @@ -26,6 +26,19 @@ def emit_errors(static_analysis) end end +ALLOWED_WARNINGS = [ + # https://github.com/browserslist/browserslist/blob/d0ec62eb48c41c218478cd3ac28684df051cc865/node.js#L329 + # warns if caniuse-lite package is older than 6 months. Ignore this + # warning message so that GitLab backports don't fail. + "Browserslist: caniuse-lite is outdated. Please run next command `yarn upgrade`" +].freeze + +def warning_count(static_analysis) + static_analysis.warned_results + .reject { |result| ALLOWED_WARNINGS.include?(result.stderr.strip) } + .count +end + def jobs_to_run(node_index, node_total) all_tasks = [ %w[bin/rake lint:all], @@ -81,7 +94,7 @@ elsif static_analysis.all_success? emit_warnings(static_analysis) - exit 2 + exit 2 if warning_count(static_analysis).nonzero? else puts 'Some static analyses failed:' |