From fbe3f643c22d9934873c2a302e7bd72954c48e84 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Tue, 12 Apr 2022 18:39:15 +0200 Subject: [PATCH] Fix code style. --- lib/tasks/fluor.rake | 4 ++-- lib/tasks/git.rake | 9 +++++++-- lib/tasks/vscode.rake | 9 +++++---- lib/tasks/xcode.rake | 2 +- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/lib/tasks/fluor.rake b/lib/tasks/fluor.rake index 81c45952..469031dc 100644 --- a/lib/tasks/fluor.rake +++ b/lib/tasks/fluor.rake @@ -18,13 +18,13 @@ task :fluor => [:'brew:casks_and_formulae'] do { id: 'csgo_osx64', path: '~/Library/Application Support/Steam/steamapps/common/Counter-Strike Global Offensive/csgo_osx64', - } + }, ] write 'AppRules', games.map { |id:, path:| { 'behaviour' => 2, - 'id' => bundle_id, + 'id' => id, 'path' => File.expand_path(path), } } diff --git a/lib/tasks/git.rake b/lib/tasks/git.rake index efb999cf..90b02db7 100644 --- a/lib/tasks/git.rake +++ b/lib/tasks/git.rake @@ -36,7 +36,10 @@ namespace :git do command 'git', 'config', '--global', 'diff.strings.binary', 'false' add_line_to_file git_attributes, '*.strings utf16 diff=strings' - command 'git', 'config', '--global', 'diff.sops.textconv', 'sh -c "echo \'-----BEGIN SOPS ENCRYPTED CONTENT-----\' && sops -d \\"${@}\\" && echo \'-----END SOPS ENCRYPTED CONTENT-----\'"' + command 'git', 'config', '--global', 'diff.sops.textconv', + 'sh -c "echo \'-----BEGIN SOPS ENCRYPTED CONTENT-----\' && ' \ + 'sops -d \\"${@}\\" && ' \ + 'echo \'-----END SOPS ENCRYPTED CONTENT-----\'"' command 'git', 'config', '--global', 'diff.sops.binary', 'false' add_line_to_file git_attributes, '*.enc.yml diff=sops' @@ -46,6 +49,7 @@ namespace :git do git_gpg = which 'git-gpg' raise if git_gpg.nil? + command 'git', 'config', '--global', 'gpg.program', git_gpg # Always use SSH URLs for pushing to GitHub and for pulling from private repositories. @@ -82,7 +86,8 @@ namespace :git do gpg = which 'gpg' raise if gpg.nil? - git_gpg = git_bin_path/'git-gpg' + + git_gpg = git_bin_path.join('git-gpg') git_gpg.write <<~SH #!/usr/bin/env bash diff --git a/lib/tasks/vscode.rake b/lib/tasks/vscode.rake index 0abe15f2..4c8d0995 100644 --- a/lib/tasks/vscode.rake +++ b/lib/tasks/vscode.rake @@ -5,9 +5,7 @@ require 'json' task :vscode do settings_path = Pathname('~/Library/Application Support/Code/User/settings.json').expand_path - settings = settings_path.exist? ? JSON.parse(settings_path.read) : {} - - settings.merge!({ + settings = { 'trailing-spaces.trimOnSave' => true, 'trailing-spaces.highlightCurrentLine' => false, # FIXME: https://github.com/shardulm94/vscode-trailingspaces/issues/55 @@ -20,7 +18,10 @@ task :vscode do 'editor.cursorWidth' => 1, 'editor.tabSize' => 2, 'editor.fontSize' => 13, - }) + } + + # Combine wanted with existing settings. + settings = JSON.parse(settings_path.read).merge(settings) if settings_path.exist? settings_path.write JSON.pretty_generate(settings) diff --git a/lib/tasks/xcode.rake b/lib/tasks/xcode.rake index 10e86fbd..f4410924 100644 --- a/lib/tasks/xcode.rake +++ b/lib/tasks/xcode.rake @@ -28,7 +28,7 @@ namespace :xcode do pkg = '/Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg' ruby_include_dir = Pathname('/System/Library/Frameworks/Ruby.framework/Versions/Current/usr/include') - header = ruby_include_dir / 'ruby-2.3.0/universal-darwin18/ruby/config.h' + header = ruby_include_dir.join('ruby-2.3.0/universal-darwin18/ruby/config.h') command sudo, 'installer', '-pkg', pkg, '-target', '/' if File.exist?(pkg) && !header.exist? end