diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 11c263c..765e83f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,14 +9,14 @@ jobs: shellcheck: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: lumaxis/shellcheck-problem-matchers@v1 - with: - format: gcc - - name: Run ShellCheck - uses: ludeeus/action-shellcheck@master - env: - SHELLCHECK_OPTS: --format=gcc + - uses: actions/checkout@v3 + - uses: lumaxis/shellcheck-problem-matchers@v1 + with: + format: gcc + - name: Run ShellCheck + uses: ludeeus/action-shellcheck@master + env: + SHELLCHECK_OPTS: --format=gcc rubocop: runs-on: ubuntu-latest @@ -26,7 +26,7 @@ jobs: with: ruby-version: 2.7 - run: gem install rubocop --no-doc - - run: rubocop --format progress --format json --out rubocop.json + - run: rubocop --display-cop-names --format progress --format json --out rubocop.json - uses: duderman/rubocop-annotate-action@v0.1.0 with: path: rubocop.json diff --git a/Rakefile b/Rakefile index 55a0b1f..e353531 100644 --- a/Rakefile +++ b/Rakefile @@ -18,8 +18,8 @@ module Rake default_path = Dir.glob('/etc/paths{,.d/*}') .flat_map { |f| File.read(f).strip.split("\n") } - if File.exist?('/etc/environment') - default_path += File.read('/etc/environment')[/PATH=(?:"([^"]+)"|'([^']+)')/, 1]&.split(File::PATH_SEPARATOR) || [] + if File.exist?('/etc/environment') && (path = File.read('/etc/environment')[/PATH=(?:"([^"]+)"|'([^']+)')/, 1]) + default_path += path.split(File::PATH_SEPARATOR) end if default_path.empty? diff --git a/lib/tasks/brew.rake b/lib/tasks/brew.rake index f4dd909..c8b1435 100644 --- a/lib/tasks/brew.rake +++ b/lib/tasks/brew.rake @@ -211,7 +211,7 @@ namespace :brew do 'yq' => {}, }.freeze - wanted_formulae = wanted_formulae.merge({ + wanted_formulae = wanted_formulae.merge( 'duti' => {}, 'imageoptim-cli' => {}, 'lockscreen' => {}, @@ -221,7 +221,7 @@ namespace :brew do 'tag' => {}, 'telnet' => {}, 'terminal-notifier' => {}, - }).freeze if macos? + ).freeze if macos? wanted_formulae = wanted_formulae.merge(wanted_fonts).freeze if linux? @@ -372,7 +372,7 @@ namespace :brew do }.uniq } - dependency_graph.each do |key, _| + dependency_graph.each_key do |key| dependency_graph[key] = recursive_dependencies.call(key) end diff --git a/lib/tasks/zed.rake b/lib/tasks/zed.rake index c250be3..eb73946 100644 --- a/lib/tasks/zed.rake +++ b/lib/tasks/zed.rake @@ -5,13 +5,13 @@ require 'json' task :zed => [:'brew:casks_and_formulae'] do zed_config = Pathname('~/.config/zed/settings.json').expand_path - zed_config.write JSON.pretty_generate({ + zed_config.write JSON.pretty_generate( 'theme' => 'Solarized Dark', 'telemetry' => { 'metrics' => false }, 'buffer_font_size' => 13, 'buffer_font_family' => 'SauceCodePro Nerd Font Mono', - 'seed_search_query_from_cursor' => 'never', - }) + 'seed_search_query_from_cursor' => 'never', + ) end