Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update rubocop to 0.18.0.

  • Loading branch information...
commit 6e6e76fe05960fa0b4fce9f2b7a0d8ca1a34b53f 1 parent e6c60c4
@nex3 nex3 authored
Showing with 21 additions and 54 deletions.
  1. +18 −18 .rubocop.yml
  2. +1 −1  Gemfile
  3. +0 −1  lib/sass/engine.rb
  4. +0 −1  lib/sass/exec.rb
  5. +0 −1  lib/sass/features.rb
  6. +0 −1  lib/sass/importers/base.rb
  7. +0 −1  lib/sass/importers/deprecated_path.rb
  8. +0 −1  lib/sass/importers/filesystem.rb
  9. +1 −4 lib/sass/logger.rb
  10. +0 −2  lib/sass/logger/base.rb
  11. +0 −2  lib/sass/logger/log_level.rb
  12. +0 −1  lib/sass/plugin.rb
  13. +0 −1  lib/sass/plugin/compiler.rb
  14. +0 −1  lib/sass/plugin/configuration.rb
  15. +0 −1  lib/sass/script/css_lexer.rb
  16. +0 −1  lib/sass/script/css_parser.rb
  17. +0 −1  lib/sass/script/lexer.rb
  18. +0 −1  lib/sass/script/tree/list_literal.rb
  19. +0 −1  lib/sass/script/value/bool.rb
  20. +0 −1  lib/sass/script/value/null.rb
  21. +0 −1  lib/sass/scss/css_parser.rb
  22. +0 −1  lib/sass/scss/parser.rb
  23. +0 −1  lib/sass/scss/script_lexer.rb
  24. +0 −1  lib/sass/scss/script_parser.rb
  25. +1 −1  lib/sass/source/map.rb
  26. +0 −1  lib/sass/tree/prop_node.rb
  27. +0 −1  lib/sass/tree/visitors/check_nesting.rb
  28. +0 −1  lib/sass/tree/visitors/deep_copy.rb
  29. +0 −4 lib/sass/util.rb
View
36 .rubocop.yml
@@ -1,3 +1,6 @@
+AccessorMethodName:
+ # We have good reasons for choosing our method names.
+ Enabled: false
AlignParameters:
# Nathan doesn't like to align parameters to the method call.
Enabled: false
@@ -16,6 +19,9 @@ CollectionMethods:
reduce: 'inject'
detect: 'find'
find_all: 'select'
+CyclomaticComplexity:
+ # It's difficult to reason about what will reduce cyclomatic complexity.
+ Enabled: false
Documentation:
# TODO: We need to add a bunch of docs before we can enable this.
Enabled: false
@@ -23,10 +29,6 @@ DotPosition:
# This check doesn't want chained method invocation to end with a dot.
# But we like to do that.
Enabled: false
-EmptyLines:
- # We need these empty lines to separate internal comments from docstrings.
- # TODO: Re-enable this by adding an option do ignore empty lines between comments.
- Enabled: false
EmptyLineBetweenDefs:
AllowAdjacentOneLineDefs: true
Encoding:
@@ -51,6 +53,9 @@ HashMethods:
IfUnlessModifier:
# We don't feel strongly about this.
Enabled: false
+IndentationConsistency:
+ # We use indentation to convey meaning more often than we screw it up.
+ Enabled: false
Lambda:
# We are a 1.8 compatible project still.
Enabled: false
@@ -67,22 +72,17 @@ MethodLength:
ModuleFunction:
# The module_function declaration makes methods private so it means you can't use the module as a module.
Enabled: false
-NumericLiterals:
- # Fails for hex literals.
- # Bug reported: https://github.com/bbatsov/rubocop/issues/502
- # TODO: Reenable this after the next rubocop release.
- Enabled: false
ParenthesesAroundCondition:
AllowSafeAssignment: true
PerlBackrefs:
# We like perl backrefs.
Enabled: false
+PredicateName:
+ # We have good reasons for choosing our method names.
+ Enabled: false
RaiseArgs:
# We prefer "raise Exception.new(msg)".
EnforcedStyle: compact
-ReduceArguments:
- # We prefer to name things well.
- Enabled: false
RedundantReturn:
# We allow explicit returns for multiple return values.
AllowMultipleReturnValues: true
@@ -92,6 +92,9 @@ Semicolon:
SignalException:
# We like saying raise.
Enabled: false
+SingleLineBlockParams:
+ # We have good reasons for choosing our argument names.
+ Enabled: false
SingleLineMethods:
# We like single line methods for simple methods.
Enabled: false
@@ -100,17 +103,14 @@ SpaceAroundBlockBraces:
EnforcedStyle: no_space_inside_braces
SpaceBeforeBlockParameters: false
SpaceInsideHashLiteralBraces:
- EnforcedStyleIsWithSpaces: false
+ EnforcedStyle: no_space
StringLiterals:
# They say to not use double quoted strings unless there is interpolation.
# While this gives a marginal parse time speedup, it makes working with
# strings annoying.
Enabled: false
-SymbolName:
- # Checks that symbols are snake_case. This is disabled because ruby constants
- # are not snake case and referring to them often requires the use of symbols.
- # TODO: Re-enable this by adding an option to allow CamelCase and SCREAMING_SNAKE_CASE.
- AllowCamelCase: true
+TrailingComma:
+ Enabled: false
TrivialAccessors:
AllowPredicates: true
ExactNameMatch: true
View
2  Gemfile
@@ -7,7 +7,7 @@ gem 'rake'
# Pin this version since Rubocop occasionally adds new cops in
# incremental releases and we don't want out builds going red because
# of that.
-gem 'rubocop', '= 0.14.1' unless RUBY_VERSION =~ /^1\.8/
+gem 'rubocop', '= 0.18.0' unless RUBY_VERSION =~ /^1\.8/
if RUBY_VERSION =~ /^1\.8/
gem 'listen', '~> 1.1.0'
View
1  lib/sass/engine.rb
@@ -52,7 +52,6 @@
require 'sass/supports'
module Sass
-
# A Sass mixin or function.
#
# `name`: `String`
View
1  lib/sass/exec.rb
@@ -543,7 +543,6 @@ def default_sass_path
[::Sass::Importers::DeprecatedPath.new(".")]
end
end
-
end
class Scss < Sass
View
1  lib/sass/features.rb
@@ -3,7 +3,6 @@ module Sass
# Provides `Sass.has_feature?` which allows for simple feature detection
# by providing a feature name.
module Features
-
# This is the set of features that can be detected.
KNOWN_FEATURES = Set[*%w{
}]
View
1  lib/sass/importers/base.rb
@@ -21,7 +21,6 @@ module Importers
#
# @abstract
class Base
-
# Find a Sass file relative to another file.
# Importers without a notion of "relative paths"
# should just return nil here.
View
1  lib/sass/importers/deprecated_path.rb
@@ -4,7 +4,6 @@ module Importers
# import a file. It is used to deprecate the current working
# directory from the list of automatic sass load paths.
class DeprecatedPath < Filesystem
-
# @param root [String] The absolute, expanded path to the folder that is deprecated.
def initialize(root)
@specified_root = root
View
1  lib/sass/importers/filesystem.rb
@@ -6,7 +6,6 @@ module Importers
# The default importer, used for any strings found in the load path.
# Simply loads Sass files from the filesystem using the default logic.
class Filesystem < Base
-
attr_accessor :root
# Creates a new filesystem importer that imports files relative to a given path.
View
5 lib/sass/logger.rb
@@ -1,12 +1,9 @@
-module Sass::Logger
-
-end
+module Sass::Logger; end
require "sass/logger/log_level"
require "sass/logger/base"
module Sass
-
class << self
attr_accessor :logger
end
View
2  lib/sass/logger/base.rb
@@ -1,7 +1,6 @@
require 'sass/logger/log_level'
class Sass::Logger::Base
-
include Sass::Logger::LogLevel
attr_accessor :log_level
@@ -28,5 +27,4 @@ def log(level, message)
def _log(level, message)
Kernel.warn(message)
end
-
end
View
2  lib/sass/logger/log_level.rb
@@ -1,7 +1,6 @@
module Sass
module Logger
module LogLevel
-
def self.included(base)
base.extend(ClassMethods)
end
@@ -41,7 +40,6 @@ def #{name}(message)
RUBY
end
end
-
end
end
end
View
1  lib/sass/plugin.rb
@@ -120,7 +120,6 @@ def respond_to?(method)
def options
compiler.options
end
-
end
end
View
1  lib/sass/plugin/compiler.rb
@@ -8,7 +8,6 @@
require 'sass/plugin/staleness_checker'
module Sass::Plugin
-
# The Compiler class handles compilation of multiple files and/or directories,
# including checking which CSS files are out-of-date and need to be updated
# and calling Sass to perform the compilation on those files.
View
1  lib/sass/plugin/configuration.rb
@@ -4,7 +4,6 @@ module Plugin
# so that we can load it independently in Rails 3,
# where the full plugin stuff is lazy-loaded.
module Configuration
-
# Returns the default options for a {Sass::Plugin::Compiler}.
#
# @return [{Symbol => Object}]
View
1  lib/sass/script/css_lexer.rb
@@ -4,7 +4,6 @@ module Script
#
# @see Sass::SCSS::CssParser
class CssLexer < Lexer
-
private
def token
View
1  lib/sass/script/css_parser.rb
@@ -7,7 +7,6 @@ module Script
#
# @see Sass::SCSS::CssParser
class CssParser < Parser
-
private
# @private
View
1  lib/sass/script/lexer.rb
@@ -98,7 +98,6 @@ def offset
}
class << self
-
private
def string_re(open, close)
View
1  lib/sass/script/tree/list_literal.rb
@@ -44,7 +44,6 @@ def to_sass(opts = {})
members.join(sep_str(nil))
end
-
# @see Node#deep_copy
def deep_copy
node = dup
View
1  lib/sass/script/value/bool.rb
@@ -1,7 +1,6 @@
module Sass::Script::Value
# A SassScript object representing a boolean (true or false) value.
class Bool < Base
-
# The true value in SassScript.
#
# This is assigned before new is overridden below so that we use the default implementation.
View
1  lib/sass/script/value/null.rb
@@ -1,7 +1,6 @@
module Sass::Script::Value
# A SassScript object representing a null value.
class Null < Base
-
# The null value in SassScript.
#
# This is assigned before new is overridden below so that we use the default implementation.
View
1  lib/sass/scss/css_parser.rb
@@ -7,7 +7,6 @@ module SCSS
# parent references, nested selectors, and so forth.
# It does support all the same CSS hacks as the SCSS parser, though.
class CssParser < StaticParser
-
private
def placeholder_selector; nil; end
View
1  lib/sass/scss/parser.rb
@@ -5,7 +5,6 @@ module SCSS
# The parser for SCSS.
# It parses a string of code into a tree of {Sass::Tree::Node}s.
class Parser
-
# Expose for the SASS parser.
attr_accessor :offset
View
1  lib/sass/scss/script_lexer.rb
@@ -4,7 +4,6 @@ module SCSS
# that makes them usable by {SCSS::Parser} to parse SassScript.
# In particular, the lexer doesn't support `!` for a variable prefix.
module ScriptLexer
-
private
def variable
View
1  lib/sass/scss/script_parser.rb
@@ -6,7 +6,6 @@ module SCSS
# when there's more content in the lexer once lexing is done.
# In addition, the parser doesn't support `!` for a variable prefix.
module ScriptParser
-
private
# @private
View
2  lib/sass/source/map.rb
@@ -96,7 +96,7 @@ def to_json(options)
css_uri, css_path, sourcemap_path =
[:css_uri, :css_path, :sourcemap_path].map {|o| options[o]}
unless css_uri || (css_path && sourcemap_path)
- raise ArgumentError.new("Sass::Source::Map#to_json requires either " +
+ raise ArgumentError.new("Sass::Source::Map#to_json requires either " \
"the :css_uri option or both the :css_path and :soucemap_path options.")
end
css_path &&= Pathname.pwd.join(Pathname.new(css_path)).cleanpath
View
1  lib/sass/tree/prop_node.rb
@@ -166,7 +166,6 @@ def val_to_sass_div(node, opts)
Sass::Script::Value::String.new("(#{node.to_sass(opts)})")
end
-
end
end
end
View
1  lib/sass/tree/visitors/check_nesting.rb
@@ -1,6 +1,5 @@
# A visitor for checking that all nodes are properly nested.
class Sass::Tree::Visitors::CheckNesting < Sass::Tree::Visitors::Base
-
protected
def initialize
View
1  lib/sass/tree/visitors/deep_copy.rb
@@ -1,6 +1,5 @@
# A visitor for copying the full structure of a Sass tree.
class Sass::Tree::Visitors::DeepCopy < Sass::Tree::Visitors::Base
-
protected
def visit(node)
View
4 lib/sass/util.rb
@@ -669,7 +669,6 @@ def ordered_hash(*pairs_or_hash)
(pairs_or_hash.is_a?(NormalizedMap) ? NormalizedMap : OrderedHash)[*flatten(pairs_or_hash, 1)]
end
-
# Checks that the encoding of a string is valid in Ruby 1.9
# and cleans up potential encoding gotchas like the UTF-8 BOM.
# If it's not, yields an error string describing the invalid character
@@ -1127,7 +1126,6 @@ def atomic_create_and_write_file(filename)
# rubocop:disable LineLength
-
# Calculates the memoization table for the Least Common Subsequence algorithm.
# Algorithm from [Wikipedia](http://en.wikipedia.org/wiki/Longest_common_subsequence_problem#Computing_the_length_of_the_LCS)
def lcs_table(x, y)
@@ -1148,10 +1146,8 @@ def lcs_table(x, y)
end
c
end
-
# rubocop:disable ParameterLists, LineLength
-
# Computes a single longest common subsequence for arrays x and y.
# Algorithm from [Wikipedia](http://en.wikipedia.org/wiki/Longest_common_subsequence_problem#Reading_out_an_LCS)
def lcs_backtrace(c, x, y, i, j, &block)
Please sign in to comment.
Something went wrong with that request. Please try again.