<commit_before># frozen_string_literal: true

directory node['google-java-format']['install_dir'] do |variable|
  owner 'root'
  group 'root'
  mode '0755'
  recursive true
  action :create
end

version = node['google-java-format']['version']
jar_url = "https://github.com/google/google-java-format/releases/download/google-java-format-#{version}/google-java-format-#{version}-all-deps.jar"
install_path = File.join(node['google-java-format']['install_dir'], 'google-java-format')

jar_base_name = File.basename(jar_url)
remote_file File.join(Chef::Config['file_cache_path'], jar_base_name) do
  source jar_url
  checksum node['google-java-format']['checksum']
end

bash 'install_google-java-format' do
  user 'root'
  cwd  Chef::Config['file_cache_path']
  code <<-EOH
    cp #{jar_base_name} #{install_path}
    chmod 0755 #{install_path}
  EOH

  not_if File.exist?(install_path) && Digest::SHA256.file(install_path) == node['google-java-format']['checksum']
end<commit_msg>fix runtime error<commit_after># frozen_string_literal: true

directory node['google-java-format']['install_dir'] do |variable|
  owner 'root'
  group 'root'
  mode '0755'
  recursive true
  action :create
end

version = node['google-java-format']['version']
jar_url = "https://github.com/google/google-java-format/releases/download/google-java-format-#{version}/google-java-format-#{version}-all-deps.jar"
install_path = File.join(node['google-java-format']['install_dir'], 'google-java-format')

jar_base_name = File.basename(jar_url)
remote_file File.join(Chef::Config['file_cache_path'], jar_base_name) do
  source jar_url
  checksum node['google-java-format']['checksum']
end

bash 'install_google-java-format' do
  user 'root'
  cwd  Chef::Config['file_cache_path']
  code <<-EOH
    cp #{jar_base_name} #{install_path}
    chmod 0755 #{install_path}
  EOH

  not_if { File.exist?(install_path) && Digest::SHA256.file(install_path) == node['google-java-format']['checksum'] }
end
{'fraction_non_alphanumeric': 0.15902140672782875, 'fraction_numerical': 0.011213047910295617, 'mean_word_length': 5.887719298245614, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3720734', 'n_tokens_mistral': 699, 'n_tokens_neox': 680, 'n_words': 115}