Skip to content

Commit

Permalink
Merge pull request #20 from xinminlabs/awesomecode-lint-ruby-magiccom…
Browse files Browse the repository at this point in the history
…ment-47701

Auto corrected by following Lint Ruby MagicComment
  • Loading branch information
flyerhzm authored Jan 9, 2021
2 parents 2c62c76 + c4d8a09 commit bb9f383
Show file tree
Hide file tree
Showing 54 changed files with 86 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

source 'https://rubygems.org'

# Specify your gem's dependencies in synvert.gemspec
Expand Down
2 changes: 2 additions & 0 deletions Guardfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

guard :rspec, cmd: 'bundle exec rspec' do
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
Expand Down
2 changes: 2 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "bundler/gem_tasks"
require 'rspec/core/rake_task'

Expand Down
2 changes: 2 additions & 0 deletions lib/synvert/core.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "synvert/core/version"

# coding: utf-8
Expand Down
2 changes: 2 additions & 0 deletions lib/synvert/core/configuration.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# encoding: utf-8
# frozen_string_literal: true

require 'singleton'

module Synvert::Core
Expand Down
1 change: 1 addition & 0 deletions lib/synvert/core/engine.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# encoding: utf-8
# frozen_string_literal: true

module Synvert::Core
# Engine defines how to encode / decode other files (like erb).
Expand Down
2 changes: 2 additions & 0 deletions lib/synvert/core/engine/erb.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# encoding: utf-8
# frozen_string_literal: true

require 'erubis'

module Synvert::Core
Expand Down
2 changes: 2 additions & 0 deletions lib/synvert/core/exceptions.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Synvert::Core
# Rewriter not found exception.
class RewriterNotFound < Exception
Expand Down
2 changes: 2 additions & 0 deletions lib/synvert/core/node_ext.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Parser::AST
# ArgumentsNode allows to handle all args as one node or handle all args as an array.
class ArgumentsNode
Expand Down
1 change: 1 addition & 0 deletions lib/synvert/core/rewriter.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# encoding: utf-8
# frozen_string_literal: true

module Synvert::Core
# Rewriter is the top level namespace in a snippet.
Expand Down
1 change: 1 addition & 0 deletions lib/synvert/core/rewriter/action.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# encoding: utf-8
# frozen_string_literal: true

module Synvert::Core
# Action defines rewriter action, add, replace or remove code.
Expand Down
1 change: 1 addition & 0 deletions lib/synvert/core/rewriter/action/append_action.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# encoding: utf-8
# frozen_string_literal: true

module Synvert::Core
# AppendAction to append code to the bottom of node body.
Expand Down
1 change: 1 addition & 0 deletions lib/synvert/core/rewriter/action/insert_action.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# encoding: utf-8
# frozen_string_literal: true

module Synvert::Core
# InsertAction to insert code to the top of node body.
Expand Down
1 change: 1 addition & 0 deletions lib/synvert/core/rewriter/action/insert_after_action.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# encoding: utf-8
# frozen_string_literal: true

module Synvert::Core
# InsertAfterAction to insert code next to the node.
Expand Down
1 change: 1 addition & 0 deletions lib/synvert/core/rewriter/action/remove_action.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# encoding: utf-8
# frozen_string_literal: true

module Synvert::Core
# RemoveAction to remove code.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# encoding: utf-8
# frozen_string_literal: true

module Synvert::Core
# ReplaceErbStmtWithExprAction to replace erb stmt code to expr,
Expand Down
1 change: 1 addition & 0 deletions lib/synvert/core/rewriter/action/replace_with_action.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# encoding: utf-8
# frozen_string_literal: true

module Synvert::Core
# ReplaceWithAction to replace code.
Expand Down
1 change: 1 addition & 0 deletions lib/synvert/core/rewriter/condition.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# encoding: utf-8
# frozen_string_literal: true

module Synvert::Core
# Condition checks if rules matches.
Expand Down
1 change: 1 addition & 0 deletions lib/synvert/core/rewriter/condition/if_exist_condition.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# encoding: utf-8
# frozen_string_literal: true

module Synvert::Core
# IfExistCondition checks if matching node exists in the node children.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# encoding: utf-8
# frozen_string_literal: true

module Synvert::Core
# IfExistCondition checks if node has only one child node and the child node matches rules.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# encoding: utf-8
# frozen_string_literal: true

module Synvert::Core
# UnlessExistCondition checks if matching node doesn't exist in the node children.
Expand Down
1 change: 1 addition & 0 deletions lib/synvert/core/rewriter/gem_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# encoding: utf-8
# frozen_string_literal: true

module Synvert::Core
# GemSpec checks and compares gem version.
Expand Down
1 change: 1 addition & 0 deletions lib/synvert/core/rewriter/helper.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# encoding: utf-8
# frozen_string_literal: true

module Synvert::Core
# Rewriter::Helper provides some helper methods to make it easier to write a snippet.
Expand Down
1 change: 1 addition & 0 deletions lib/synvert/core/rewriter/instance.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# encoding: utf-8
# frozen_string_literal: true

module Synvert::Core
# Instance is an execution unit, it finds specified ast nodes,
Expand Down
1 change: 1 addition & 0 deletions lib/synvert/core/rewriter/ruby_version.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# encoding: utf-8
# frozen_string_literal: true

module Synvert::Core
# GemSpec checks and compares gem version.
Expand Down
1 change: 1 addition & 0 deletions lib/synvert/core/rewriter/scope.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# encoding: utf-8
# frozen_string_literal: true

module Synvert::Core
# Scope finds out nodes which match rules.
Expand Down
1 change: 1 addition & 0 deletions lib/synvert/core/rewriter/scope/goto_scope.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# encoding: utf-8
# frozen_string_literal: true

module Synvert::Core
# Go to and change its scope to a child node.
Expand Down
1 change: 1 addition & 0 deletions lib/synvert/core/rewriter/scope/within_scope.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# encoding: utf-8
# frozen_string_literal: true

module Synvert::Core
# WithinScope finds out nodes which match rules, then change its scope to matching node.
Expand Down
1 change: 1 addition & 0 deletions lib/synvert/core/rewriter/warning.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# encoding: utf-8
# frozen_string_literal: true

module Synvert::Core
# Warning is used to save warning message.
Expand Down
1 change: 1 addition & 0 deletions lib/synvert/core/version.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# coding: utf-8
# frozen_string_literal: true

module Synvert
module Core
Expand Down
2 changes: 2 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "..", "lib"))

require 'synvert/core'
Expand Down
2 changes: 2 additions & 0 deletions spec/support/parser_helper.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module ParserHelper
def parse(code)
Parser::CurrentRuby.parse code
Expand Down
2 changes: 2 additions & 0 deletions spec/synvert/core/configuration_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

module Synvert::Core
Expand Down
2 changes: 2 additions & 0 deletions spec/synvert/core/engine/erb_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

module Synvert::Core
Expand Down
2 changes: 2 additions & 0 deletions spec/synvert/core/node_ext_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

describe Parser::AST::Node do
Expand Down
2 changes: 2 additions & 0 deletions spec/synvert/core/rewriter/action/append_action_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

module Synvert::Core
Expand Down
2 changes: 2 additions & 0 deletions spec/synvert/core/rewriter/action/insert_action_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

module Synvert::Core
Expand Down
2 changes: 2 additions & 0 deletions spec/synvert/core/rewriter/action/insert_after_action_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

module Synvert::Core
Expand Down
2 changes: 2 additions & 0 deletions spec/synvert/core/rewriter/action/remove_action_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

module Synvert::Core
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

module Synvert::Core
Expand Down
2 changes: 2 additions & 0 deletions spec/synvert/core/rewriter/action/replace_with_action_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

module Synvert::Core
Expand Down
2 changes: 2 additions & 0 deletions spec/synvert/core/rewriter/action_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

module Synvert::Core
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

module Synvert::Core
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

module Synvert::Core
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

module Synvert::Core
Expand Down
2 changes: 2 additions & 0 deletions spec/synvert/core/rewriter/condition_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

module Synvert::Core
Expand Down
2 changes: 2 additions & 0 deletions spec/synvert/core/rewriter/gem_spec_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

module Synvert::Core
Expand Down
2 changes: 2 additions & 0 deletions spec/synvert/core/rewriter/helper_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

module Synvert::Core
Expand Down
2 changes: 2 additions & 0 deletions spec/synvert/core/rewriter/instance_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

module Synvert::Core
Expand Down
2 changes: 2 additions & 0 deletions spec/synvert/core/rewriter/scope/goto_scope_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

module Synvert::Core
Expand Down
2 changes: 2 additions & 0 deletions spec/synvert/core/rewriter/scope/within_scope.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

module Synvert::Core
Expand Down
2 changes: 2 additions & 0 deletions spec/synvert/core/rewriter/scope_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

module Synvert::Core
Expand Down
2 changes: 2 additions & 0 deletions spec/synvert/core/rewriter/warning_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

module Synvert::Core
Expand Down
2 changes: 2 additions & 0 deletions spec/synvert/core/rewriter_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

module Synvert::Core
Expand Down

0 comments on commit bb9f383

Please sign in to comment.