sapristi-tool/sapristi

View on GitHub

Showing 114 of 114 total issues

Line is too long. [109/80]
Open

      raise Error, 'No command or window title specified' unless definition['Command'] || definition['Title']
Severity: Minor
Found in lib/sapristi/definition.rb by rubocop

Line is too long. [106/80]
Open

        ::Sapristi.logger.warn "Monitor #{name} not found. Using #{main['name']}, available=#{aval_names}"
Severity: Minor
Found in lib/sapristi/monitor_manager.rb by rubocop

Use match? instead of match when MatchData is not used.
Open

      raise OptionParser::InvalidOption, "'#{value}' is not an integer" unless value.match(/^[0-9]+$/)
Severity: Minor
Found in lib/sapristi/arguments_parser.rb by rubocop

In Ruby 2.4, String#match?, Regexp#match? and Symbol#match? have been added. The methods are faster than match. Because the methods avoid creating a MatchData object or saving backref. So, when MatchData is not used, use match? instead of match.

Example:

# bad
def foo
  if x =~ /re/
    do_something
  end
end

# bad
def foo
  if x.match(/re/)
    do_something
  end
end

# bad
def foo
  if /re/ === x
    do_something
  end
end

# good
def foo
  if x.match?(/re/)
    do_something
  end
end

# good
def foo
  if x =~ /re/
    do_something(Regexp.last_match)
  end
end

# good
def foo
  if x.match(/re/)
    do_something($~)
  end
end

# good
def foo
  if /re/ === x
    do_something($~)
  end
end

Line is too long. [90/80]
Open

        log.debug "Found window by title=#{title}, id=#{window.id}, title=#{window.title}"

Line is too long. [103/80]
Open

      raise Error, "Invalid monitor=#{definition['Monitor']}" if definition['Monitor']&.to_i&.negative?
Severity: Minor
Found in lib/sapristi/definition.rb by rubocop

Line is too long. [95/80]
Open

  guard :rubocop, all_on_start: false, cli: ['--format', 'html', '-o', './tmp/rubocop.html'] do
Severity: Minor
Found in Guardfile by rubocop

Line is too long. [96/80]
Open

  # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
Severity: Minor
Found in sapristi.gemspec by rubocop

Line is too long. [95/80]
Open

        geometry = complete_geometry(window.id, x_position: x_position, y_position: y_position)

Line is too long. [120/80]
Open

      raise OptionParser::InvalidOption, "requires a wait time > 0, provided=#{value}" unless min.nil? || integer >= min
Severity: Minor
Found in lib/sapristi/arguments_parser.rb by rubocop

Line is too long. [93/80]
Open

        log.debug "Found window by pid=#{waiter.pid}, id=#{window.id}, title=#{window.title}"

Line is too long. [103/80]
Open

      raise Error, "window x size=#{window_width} less than #{MIN_X_SIZE}" if window_width < MIN_X_SIZE
Severity: Minor
Found in lib/sapristi/definition_parser.rb by rubocop

Line is too long. [94/80]
Open

        (command && @process_manager.detect_window_for_process(command, title, @wait_time)) ||

Line is too long. [94/80]
Open

      definitions = definitions.filter { |definition| definition.group.eql? @group } if @group
Severity: Minor
Found in lib/sapristi/sapristi.rb by rubocop

Line is too long. [103/80]
Open

      return unless conf_file.eql?(Sapristi.user_default_configuration_file) && !File.exist?(conf_file)
Severity: Minor
Found in lib/sapristi/sapristi.rb by rubocop

Line is too long. [87/80]
Open

      opts.on('-m', '--monitors', 'Show monitor\'s info') { args.show_monitors = true }
Severity: Minor
Found in lib/sapristi/arguments_parser.rb by rubocop

Line is too long. [102/80]
Open

      raise OptionParser::InvalidOption, "'#{value}' is not an integer" unless value.match(/^[0-9]+$/)
Severity: Minor
Found in lib/sapristi/arguments_parser.rb by rubocop

Line is too long. [109/80]
Open

      raise Error, "Invalid configuration file: invalid headers=#{actual_headers}, valid=#{expected_headers}"
Severity: Minor
Found in lib/sapristi/definition.rb by rubocop

Line is too long. [95/80]
Open

        raise Error, "x=#{x_pos} is outside of monitor width dimension=0..#{monitor_width - 1}"
Severity: Minor
Found in lib/sapristi/definition_parser.rb by rubocop

Line is too long. [94/80]
Open

      raise Error, "#{windows.size} windows have the same title: #{title}" if windows.size > 1

Line is too long. [98/80]
Open

      opts.on('-g', '--group GROUP', 'Use named group definitions') { |value| args.group = value }
Severity: Minor
Found in lib/sapristi/arguments_parser.rb by rubocop
Severity
Category
Status
Source
Language