Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions .github/dangerfiles/op_primer_changes/Dangerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# frozen_string_literal: true

#-- copyright
# OpenProject is an open source project management software.
# Copyright (C) the OpenProject GmbH
#
# 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 COPYRIGHT and LICENSE files for more details.
#++

OP_PRIMER_REGEX = %r{app/components/op_primer/}

def modified_op_primer_files
(git.modified_files + git.added_files).grep(OP_PRIMER_REGEX)
end

changed_files = modified_op_primer_files

if changed_files.any?
message_lines = [
"@opf/dream-team Files in `app/components/op_primer` were modified:",
""
]

changed_files.each do |file|
message_lines << "- #{file}"
end

message_lines << <<~EOS

Please review these changes to ensure they align with the design system guidelines.
EOS

warn message_lines.join("\n")
end
1 change: 1 addition & 0 deletions Dangerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@
danger.import_dangerfile(path: ".github/dangerfiles/user_references/Dangerfile")
danger.import_dangerfile(path: ".github/dangerfiles/release_migrations/Dangerfile")
danger.import_dangerfile(path: ".github/dangerfiles/project_id_contract/Dangerfile")
danger.import_dangerfile(path: ".github/dangerfiles/op_primer_changes/Dangerfile")
Loading