Sha256: 61a7e03fa655e4dcea5699c6b0646a6e1717ce595ddb6ae522d3dd932bebca4c

Contents?: true

Size: 602 Bytes

Versions: 3

Compression:

Stored size: 602 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[RBRACE RBRACK RPAREN SEMIC COMMA COLON DOT NEWLINE DQMID DQPOST LBRACK]
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

3 entries across 3 versions & 1 rubygems

Version Path
puppet-lint-manifest_whitespace-check-0.1.12 lib/puppet-lint/plugins/tools.rb
puppet-lint-manifest_whitespace-check-0.1.11 lib/puppet-lint/plugins/tools.rb
puppet-lint-manifest_whitespace-check-0.1.10 lib/puppet-lint/plugins/tools.rb