Skip to content

Commit

Permalink
Updated .rubocop.yml to fix Style/TrailingComma deprecation error
Browse files Browse the repository at this point in the history
and fixed rubocop errors
  • Loading branch information
Matt Schreiber authored and Matt Schreiber committed Jan 21, 2016
1 parent 4989134 commit 67e0807
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
5 changes: 4 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,8 @@ Style/SpecialGlobalVars:
Style/StringLiterals:
EnforcedStyle: double_quotes

Style/TrailingComma:
Style/TrailingCommaInLiteral:
Enabled: false

Style/TrailingCommaInArguments:
Enabled: false
6 changes: 3 additions & 3 deletions lib/bashcov/lexer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ module Bashcov
# coverage
class Lexer
# Lines starting with one of these tokens are irrelevant for coverage
IGNORE_START_WITH = %w(# function)
IGNORE_START_WITH = %w(# function).freeze

# Lines ending with one of these tokens are irrelevant for coverage
IGNORE_END_WITH = %w|(|
IGNORE_END_WITH = %w|(|.freeze

# Lines containing only one of these keywords are irrelevant for coverage
IGNORE_IS = %w(esac if then else elif fi while do done { } ;;)
IGNORE_IS = %w(esac if then else elif fi while do done { } ;;).freeze

# @param [String] filename File to analyze
# @param [Hash] coverage Coverage with executed lines marked
Expand Down
5 changes: 4 additions & 1 deletion lib/bashcov/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ def run
@xtrace = Xtrace.new
fd = @xtrace.file_descriptor
options = { :in => :in, fd => fd } # bind FDs to the child process
options.merge!(out: "/dev/null", err: "/dev/null") if Bashcov.options.mute
if Bashcov.options.mute
options[:out] = "/dev/null"
options[:err] = "/dev/null"
end
env = { "BASH_XTRACEFD" => fd.to_s, "PS4" => Xtrace::PS4 }

command_pid = Process.spawn env, @command, options # spawn the command
Expand Down
4 changes: 2 additions & 2 deletions lib/bashcov/xtrace.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ module Bashcov
class Xtrace
# [String] Character that will be used to indicate the nesting level of
# +xtrace+d instructions
DEPTH_CHAR = "+"
DEPTH_CHAR = "+".freeze

# [String] Prefix used in +PS4+ to identify relevant output
PREFIX = "BASHCOV>"
PREFIX = "BASHCOV>".freeze

# [String] A randomly-generated token for delimiting the fields of the
# +{PS4}+
Expand Down

0 comments on commit 67e0807

Please sign in to comment.