Skip to content

Commit

Permalink
Merge pull request #94 from chef/new_cops
Browse files Browse the repository at this point in the history
Enable Style/Encoding cop
  • Loading branch information
tas50 committed Jul 14, 2020
2 parents 1bb8489 + 38363b8 commit e82027e
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 10 deletions.
2 changes: 2 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Style/FrozenStringLiteralComment:
Enabled: true
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
source "https://rubygems.org"

# Specify your gem's dependencies in chefstyle.gemspec
Expand Down
1 change: 1 addition & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require "bundler/gem_tasks"

upstream = Gem::Specification.find_by_name("rubocop")
Expand Down
3 changes: 1 addition & 2 deletions bin/chefstyle
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env ruby
# -*- encoding: utf-8 -*-

# frozen_string_literal: true
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), %w{.. lib})

require "chefstyle"
Expand Down
2 changes: 1 addition & 1 deletion chefstyle.gemspec
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# coding: utf-8
# frozen_string_literal: true
lib = File.expand_path("../lib", __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require "chefstyle/version"
Expand Down
10 changes: 5 additions & 5 deletions config/chefstyle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -482,11 +482,15 @@ Style/WhileUntilModifier:
Style/WordArray:
Enabled: true

# we are ruby > 2.0 only so we can remove encoding comments for utf-8
Style/Encoding:
Enabled: true

#
# Disabled Style
#

# FIXME: we need to enable this
# reduces memory usage, but isn't a simple autocorrect so we need to do this one project at a time
Style/FrozenStringLiteralComment:
Enabled: false

Expand Down Expand Up @@ -529,10 +533,6 @@ Style/FormatString:
Style/IfUnlessModifier:
Enabled: false

# we are ruby > 2.0 only so can disable the Encoding cop
Style/Encoding:
Enabled: false

# Dan is -1 on this one: https://github.com/chef/chef/pull/4526#issuecomment-179950045
Layout/IndentFirstHashElement:
Enabled: false
Expand Down
1 change: 1 addition & 0 deletions lib/chefstyle.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require_relative "chefstyle/version"

# ensure the desired target version of RuboCop is gem activated
Expand Down
5 changes: 3 additions & 2 deletions lib/chefstyle/version.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true
module Chefstyle
VERSION = "1.1.3".freeze
RUBOCOP_VERSION = "0.87.1".freeze
VERSION = "1.1.3"
RUBOCOP_VERSION = "0.87.1"
end

0 comments on commit e82027e

Please sign in to comment.