diff --git a/.rubocop.yml b/.rubocop.yml index bb69a72..59a532c 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -54,6 +54,9 @@ Style/AndOr: Style/Not: Enabled: false +Style/FrozenStringLiteralComment: + Enabled: true + Documentation: Enabled: false # TODO: Enable again once we have more docs diff --git a/Gemfile b/Gemfile index 810a817..ba6ce20 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + source "https://rubygems.org" ruby RUBY_VERSION diff --git a/Rakefile b/Rakefile index 0710298..7d829d9 100644 --- a/Rakefile +++ b/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "rubygems" require "bundler/gem_tasks" require "rspec/core/rake_task" diff --git a/lib/pundit/policy_finder.rb b/lib/pundit/policy_finder.rb index 454052d..df072d9 100644 --- a/lib/pundit/policy_finder.rb +++ b/lib/pundit/policy_finder.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Pundit # Finds policy and scope classes for given object. # @api public diff --git a/lib/pundit/rspec.rb b/lib/pundit/rspec.rb index 3e5cc83..687cf17 100644 --- a/lib/pundit/rspec.rb +++ b/lib/pundit/rspec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "active_support/core_ext/array/conversions" module Pundit diff --git a/pundit.gemspec b/pundit.gemspec index 441a56d..d0c02a2 100644 --- a/pundit.gemspec +++ b/pundit.gemspec @@ -1,3 +1,5 @@ +# frozen_string_literal: true + lib = File.expand_path("lib", __dir__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require "pundit/version" diff --git a/spec/policies/post_policy_spec.rb b/spec/policies/post_policy_spec.rb index 6b8bd1d..1d19ef9 100644 --- a/spec/policies/post_policy_spec.rb +++ b/spec/policies/post_policy_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" describe PostPolicy do diff --git a/spec/policy_finder_spec.rb b/spec/policy_finder_spec.rb index 36386ca..76533c7 100644 --- a/spec/policy_finder_spec.rb +++ b/spec/policy_finder_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" describe Pundit::PolicyFinder do diff --git a/spec/pundit_spec.rb b/spec/pundit_spec.rb index 6fe7b96..632f0c0 100644 --- a/spec/pundit_spec.rb +++ b/spec/pundit_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" describe Pundit do diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 50873af..3768762 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "pundit" require "pundit/rspec"