Skip to content

Commit

Permalink
Add fixes to indentation checker
Browse files Browse the repository at this point in the history
  • Loading branch information
greeneca committed Feb 6, 2019
1 parent 6ed2cb0 commit ba659e3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
= 4.15.1 =

- Fixes for indentation checker

= 4.15.0 =

- Add indentation checking to analyze command
Expand Down
10 changes: 7 additions & 3 deletions lib/roku_builder/plugins/indentation_inspector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ def set_indentation(line:)
end
when :brs
if @prev_line
if @prev_line =~ /[\{\[\(:]$/
if @prev_line =~ /^\'/
# Don't change indentation
elsif @prev_line =~ /[\{\[\(:]$/
@ind += @count
elsif @prev_line =~ /^\s*\bfunction\b|^\s*\bsub\b/i
@ind += @count
Expand All @@ -50,11 +52,13 @@ def set_indentation(line:)
@ind += @count
end
end
if line =~ /^\s*[\}\]\)]/
if line =~ /^\'/
# Don't change indentation
elsif line =~ /^\s*[\}\]\)]/
@ind -= @count
elsif line =~ /^\s*\bfunction\b|^\s*\bsub\b/i
@ind -= 0
elsif line =~ /^\s*#?end\b|^\s*#?endif\b|^\s*endfor\b|^\s*\bnext\b/i
elsif line =~ /^\s*:?\s*#?end\b|^\s*#?endif\b|^\s*endfor\b|^\s*\bnext\b/i
@ind -= @count
elsif line =~ /^\s*#?else\b|^\s*elseif\b/i
@ind -= @count
Expand Down
2 changes: 1 addition & 1 deletion lib/roku_builder/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

module RokuBuilder
# Version of the RokuBuilder Gem
VERSION = "4.15.0"
VERSION = "4.15.1"
end

0 comments on commit ba659e3

Please sign in to comment.