We currently use dangerfile only for jasmine fdescribe/fit tests and Angular onPush checks. Both can be replaced by eslint plugins.pull/9487/head
parent
9f5ce6cb9a
commit
02bd8ef9c2
@ -1,24 +0,0 @@ |
||||
# Fail if jasmine specs contain fdescribe or fit |
||||
fail("jasmine fdescribe/fit left in tests") if `grep --include '*.spec.ts' -rP 'fdescribe\\(|fit\\(' frontend/src/`.length > 1 |
||||
|
||||
# Search for modified components not being made OnPush |
||||
git.modified_files |
||||
.select { |path| path.include?('frontend') && path.end_with?('.ts') } |
||||
.each do |path| |
||||
next unless File.readable?(path) |
||||
|
||||
lines = File.readlines (path) |
||||
|
||||
# Ignore non component files |
||||
component_line = lines.grep(/@Component/)[0] |
||||
next unless component_line |
||||
|
||||
# Check for missing onPush |
||||
unless lines.grep(/changeDetection:\s+ChangeDetectionStrategy.OnPush/).length > 0 |
||||
warn( |
||||
"Please use `ChangeDetectionStrategy.OnPush` for this component", |
||||
file: path, |
||||
line: lines.index(component_line) || 0 |
||||
) |
||||
end |
||||
end |
@ -1,46 +0,0 @@ |
||||
#!/bin/bash |
||||
#-- encoding: UTF-8 |
||||
#-- copyright |
||||
# OpenProject is a project management system. |
||||
# Copyright (C) 2012-2015 the OpenProject Foundation (OPF) |
||||
# |
||||
# This program is free software; you can redistribute it and/or |
||||
# modify it under the terms of the GNU General Public License version 3. |
||||
# |
||||
# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: |
||||
# Copyright (C) 2006-2013 Jean-Philippe Lang |
||||
# Copyright (C) 2010-2013 the ChiliProject Team |
||||
# |
||||
# This program is free software; you can redistribute it and/or |
||||
# modify it under the terms of the GNU General Public License |
||||
# as published by the Free Software Foundation; either version 2 |
||||
# of the License, or (at your option) any later version. |
||||
# |
||||
# This program is distributed in the hope that it will be useful, |
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
# GNU General Public License for more details. |
||||
# |
||||
# You should have received a copy of the GNU General Public License |
||||
# along with this program; if not, write to the Free Software |
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
||||
# |
||||
# See doc/COPYRIGHT.rdoc for more details. |
||||
#++ |
||||
|
||||
set -e |
||||
|
||||
run() { |
||||
echo $1; |
||||
eval $1; |
||||
|
||||
echo $2; |
||||
eval $2; |
||||
} |
||||
|
||||
if [ -z "$DANGER_GITHUB_API_TOKEN" ]; then |
||||
echo "WARNING: Missing Dangerfile token. Dangerfile cannot be executed without it!" |
||||
else |
||||
run "./bin/danger --fail-on-errors=true" |
||||
fi |
||||
|
Loading…
Reference in new issue