Sha256: 77896cc50a71477b8de32a77bdff22e92af45938c0066f9965f41bef7b5e00f2

Contents?: true

Size: 620 Bytes

Versions: 11

Compression:

Stored size: 620 Bytes

Contents

# frozen_string_literal: true

def is_single_space(token)
  token.type == :WHITESPACE && token.value == ' '
end

def new_single_space
  PuppetLint::Lexer::Token.new(:WHITESPACE, ' ', 0, 0)
end

def after_bracket_tokens
  %i[RBRACK RPAREN SEMIC COMMA COLON DOT NEWLINE DQMID DQPOST LBRACK HEREDOC_MID HEREDOC_POST]
end

def prev_non_space_token(token)
  while token = token.prev_token
    return token unless %i[WHITESPACE INDENT NEWLINE].include?(token.type)
  end
end

def next_non_space_token(token)
  while token = token.next_token
    return token unless %i[WHITESPACE INDENT NEWLINE].include?(token.type)
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
puppet-lint-manifest_whitespace-check-0.3.0 lib/puppet-lint/plugins/tools.rb
puppet-lint-manifest_whitespace-check-0.2.9 lib/puppet-lint/plugins/tools.rb
puppet-lint-manifest_whitespace-check-0.2.8 lib/puppet-lint/plugins/tools.rb
puppet-lint-manifest_whitespace-check-0.2.7 lib/puppet-lint/plugins/tools.rb
puppet-lint-manifest_whitespace-check-0.2.6 lib/puppet-lint/plugins/tools.rb
puppet-lint-manifest_whitespace-check-0.2.5 lib/puppet-lint/plugins/tools.rb
puppet-lint-manifest_whitespace-check-0.2.4 lib/puppet-lint/plugins/tools.rb
puppet-lint-manifest_whitespace-check-0.2.3 lib/puppet-lint/plugins/tools.rb
puppet-lint-manifest_whitespace-check-0.2.2 lib/puppet-lint/plugins/tools.rb
puppet-lint-manifest_whitespace-check-0.2.1 lib/puppet-lint/plugins/tools.rb
puppet-lint-manifest_whitespace-check-0.2.0 lib/puppet-lint/plugins/tools.rb