Skip to content

Commit

Permalink
Reformat Ruby files for line length of 120 (#24)
Browse files Browse the repository at this point in the history
The rubocop community has decided to standardize on 120 characters for
default line length.

rubocop/rubocop#7952

Update rubocop config and reformat ruby files to embrace this
convention.
  • Loading branch information
mattbrictson committed May 23, 2020
1 parent b431578 commit 0e9b251
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 17 deletions.
1 change: 1 addition & 0 deletions .rubocop.yml
Expand Up @@ -19,6 +19,7 @@ Layout/HashAlignment:
- key

Layout/LineLength:
Max: 120
Exclude:
- "*.gemspec"

Expand Down
11 changes: 3 additions & 8 deletions Rakefile
Expand Up @@ -31,12 +31,9 @@ namespace :bump do
lowest_minor = RubyVersions.lowest_supported_minor
latest = RubyVersions.latest

replace_in_file "tomo-plugin-sidekiq.gemspec",
/ruby_version = ">= (.*)"/ => lowest

replace_in_file "tomo-plugin-sidekiq.gemspec", /ruby_version = ">= (.*)"/ => lowest
replace_in_file ".rubocop.yml", /TargetRubyVersion: (.*)/ => lowest_minor
replace_in_file ".circleci/config.yml",
%r{circleci/ruby:([\d\.]+)} => latest
replace_in_file ".circleci/config.yml", %r{circleci/ruby:([\d\.]+)} => latest

travis = YAML.safe_load(open(".travis.yml"))
travis["rvm"] = RubyVersions.latest_supported_patches + ["ruby-head"]
Expand Down Expand Up @@ -87,9 +84,7 @@ module RubyVersions

def versions
@_versions ||= begin
yaml = URI.open(
"https://raw.githubusercontent.com/ruby/www.ruby-lang.org/master/_data/downloads.yml"
)
yaml = URI.open("https://raw.githubusercontent.com/ruby/www.ruby-lang.org/master/_data/downloads.yml")
YAML.safe_load(yaml, symbolize_names: true)
end
end
Expand Down
3 changes: 0 additions & 3 deletions lib/tomo/plugin/sidekiq.rb
Expand Up @@ -6,10 +6,7 @@ module Tomo::Plugin::Sidekiq
extend Tomo::PluginDSL

tasks Tomo::Plugin::Sidekiq::Tasks

# rubocop:disable Layout/LineLength
defaults sidekiq_systemd_service: "sidekiq_%{application}.service",
sidekiq_systemd_service_path: ".config/systemd/user/%{sidekiq_systemd_service}",
sidekiq_systemd_service_template_path: File.expand_path("sidekiq/service.erb", __dir__)
# rubocop:enable Layout/LineLength
end
8 changes: 2 additions & 6 deletions lib/tomo/plugin/sidekiq/tasks.rb
Expand Up @@ -19,9 +19,7 @@ def setup_systemd
end

def log
remote.attach "journalctl", "-q",
raw("--user-unit=#{service.name.shellescape}"),
*settings[:run_args]
remote.attach "journalctl", "-q", raw("--user-unit=#{service.name.shellescape}"), *settings[:run_args]
end

private
Expand All @@ -35,9 +33,7 @@ def service
end

def linger_must_be_enabled!
linger_users = remote.list_files(
"/var/lib/systemd/linger", raise_on_error: false
)
linger_users = remote.list_files("/var/lib/systemd/linger", raise_on_error: false)
return if dry_run? || linger_users.include?(remote.host.user)

die <<~ERROR.strip
Expand Down

0 comments on commit 0e9b251

Please sign in to comment.