Skip to content

Commit

Permalink
refactor DangerPackageTodoYmlChanges to expose class helper method (#47)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
schoblaska and anokhigusto authored May 8, 2024
1 parent 4d12c5e commit 26bf47f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ GIT
PATH
remote: .
specs:
danger-packwerk (0.14.3)
danger-packwerk (0.14.4)
code_ownership
danger-plugin-api (~> 1.0)
packs
Expand Down
5 changes: 3 additions & 2 deletions lib/danger-packwerk/danger_package_todo_yml_changes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def check(
git_filesystem = Private::GitFilesystem.new(git: git, root: root_path || '')
changed_package_todo_ymls = (git_filesystem.modified_files + git_filesystem.added_files + git_filesystem.deleted_files).grep(PACKAGE_TODO_PATTERN)

violation_diff = get_violation_diff(violation_types, root_path: root_path)
violation_diff = DangerPackageTodoYmlChanges.get_violation_diff(violation_types, git: git, root_path: root_path)

before_comment.call(
violation_diff,
Expand All @@ -74,10 +74,11 @@ def check(
sig do
params(
violation_types: T::Array[String],
git: Danger::DangerfileGitPlugin,
root_path: T.nilable(String)
).returns(ViolationDiff)
end
def get_violation_diff(violation_types, root_path: nil)
def self.get_violation_diff(violation_types, git:, root_path: nil)
git_filesystem = Private::GitFilesystem.new(git: git, root: root_path || '')

added_violations, removed_violations = Private::TodoYmlChanges.get_reference_offenses(
Expand Down
2 changes: 1 addition & 1 deletion lib/danger-packwerk/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
# frozen_string_literal: true

module DangerPackwerk
VERSION = '0.14.3'
VERSION = '0.14.4'
end

0 comments on commit 26bf47f

Please sign in to comment.