Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
andyw8 committed Jan 28, 2025
1 parent 5c7fcb7 commit 628a9bf
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/ruby_lsp/tapioca/run_gem_rbi_check.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,9 @@ def initialize(project_path)

sig { void }
def run
# FileUtils.chdir(project_path) do
return log_message("Not a git repository") unless git_repo?
return log_message("Not a git repository") unless git_repo?

lockfile_changed? ? generate_gem_rbis : cleanup_orphaned_rbis
# end
lockfile_changed? ? generate_gem_rbis : cleanup_orphaned_rbis
end

private
Expand All @@ -48,7 +46,8 @@ def lockfile_changed?

sig { returns(String) }
def fetch_lockfile_diff
@lockfile_diff = File.exist?("#{project_path}/Gemfile.lock") ? %x(cd #{project_path} && git diff Gemfile.lock).strip : ""
@lockfile_diff =
File.exist?("#{project_path}/Gemfile.lock") ? %x(cd #{project_path} && git diff Gemfile.lock).strip : ""
end

sig { void }
Expand All @@ -75,7 +74,7 @@ def execute_tapioca_gem_command(gems)
"gem",
"--lsp_addon",
*gems,
chdir: project_path
chdir: project_path,
)

log_message(stdout) unless stdout.empty?
Expand All @@ -92,7 +91,8 @@ def remove_rbis(gems)

sig { void }
def cleanup_orphaned_rbis
untracked_files = %x(cd #{project_path} && git ls-files --others --exclude-standard sorbet/rbi/gems/).lines.map(&:strip)
untracked_files =
%x(cd #{project_path} && git ls-files --others --exclude-standard sorbet/rbi/gems/).lines.map(&:strip)
deleted_files = %x(cd #{project_path} && git ls-files --deleted sorbet/rbi/gems/).lines.map(&:strip)

delete_files(untracked_files, "Deleted untracked RBIs")
Expand Down

0 comments on commit 628a9bf

Please sign in to comment.