Skip to content

Commit 26bf47f

Browse files
refactor DangerPackageTodoYmlChanges to expose class helper method (#47)
* refactor DangerPackageTodoYmlChanges to expose class helper method Co-authored-by: Anokhi Kastia <[email protected]> * make git param required --------- Co-authored-by: Anokhi Kastia <[email protected]>
1 parent 4d12c5e commit 26bf47f

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ GIT
1818
PATH
1919
remote: .
2020
specs:
21-
danger-packwerk (0.14.3)
21+
danger-packwerk (0.14.4)
2222
code_ownership
2323
danger-plugin-api (~> 1.0)
2424
packs

lib/danger-packwerk/danger_package_todo_yml_changes.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def check(
4747
git_filesystem = Private::GitFilesystem.new(git: git, root: root_path || '')
4848
changed_package_todo_ymls = (git_filesystem.modified_files + git_filesystem.added_files + git_filesystem.deleted_files).grep(PACKAGE_TODO_PATTERN)
4949

50-
violation_diff = get_violation_diff(violation_types, root_path: root_path)
50+
violation_diff = DangerPackageTodoYmlChanges.get_violation_diff(violation_types, git: git, root_path: root_path)
5151

5252
before_comment.call(
5353
violation_diff,
@@ -74,10 +74,11 @@ def check(
7474
sig do
7575
params(
7676
violation_types: T::Array[String],
77+
git: Danger::DangerfileGitPlugin,
7778
root_path: T.nilable(String)
7879
).returns(ViolationDiff)
7980
end
80-
def get_violation_diff(violation_types, root_path: nil)
81+
def self.get_violation_diff(violation_types, git:, root_path: nil)
8182
git_filesystem = Private::GitFilesystem.new(git: git, root: root_path || '')
8283

8384
added_violations, removed_violations = Private::TodoYmlChanges.get_reference_offenses(

lib/danger-packwerk/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
# frozen_string_literal: true
33

44
module DangerPackwerk
5-
VERSION = '0.14.3'
5+
VERSION = '0.14.4'
66
end

0 commit comments

Comments
 (0)