Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop deleting old deprecated_references files #317

Merged
merged 1 commit into from
Mar 2, 2023
Merged
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
8 changes: 0 additions & 8 deletions lib/packwerk/package_todo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,6 @@ def stale_violations?(for_files)

sig { void }
def dump
delete_old_deprecated_references

if @new_entries.empty?
delete_if_exists
else
Expand All @@ -119,12 +117,6 @@ def delete_if_exists

private

sig { void }
def delete_old_deprecated_references
deprecated_references_filepath = File.join(File.dirname(@filepath), "deprecated_references.yml")
File.delete(deprecated_references_filepath) if File.exist?(deprecated_references_filepath)
end

sig { returns(EntriesType) }
def prepare_entries_for_dump
@new_entries.each do |package_name, package_violations|
Expand Down
16 changes: 0 additions & 16 deletions test/unit/packwerk/package_todo_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -232,22 +232,6 @@ class PackageTodoTest < Minitest::Test
refute File.exist?(file.path)
end

test "#dump deletes old deprecated_references if they exist" do
file = Tempfile.new("package_todo.yml")
deprecated_file = File.new(
File.join(File.dirname(T.must(file.path)), "deprecated_references.yml"),
"w",
)

file.write("content: true")
deprecated_file.write("content: true")

package_todo = PackageTodo.new(destination_package, T.must(file.path))
package_todo.dump

refute File.exist?(deprecated_file.path)
end

private

def destination_package
Expand Down