Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rubocop: Fix Style/FrozenStringLiteralComment #285

Merged
merged 1 commit into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,6 @@ Style/FetchEnvVar:
Exclude:
- 'lib/modulesync/git_service.rb'

# Offense count: 34
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: always, always_true, never
Style/FrozenStringLiteralComment:
Enabled: false

# Offense count: 1
# Configuration parameters: AllowedMethods.
# AllowedMethods: respond_to_missing?
Expand Down
2 changes: 2 additions & 0 deletions .simplecov
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

SimpleCov.start do
if ENV['SIMPLECOV_ROOT']
SimpleCov.root(ENV['SIMPLECOV_ROOT'])
Expand Down
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 ENV['GEM_SOURCE'] || 'https://rubygems.org'

gemspec
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 'rake/clean'
require 'cucumber/rake/task'
require 'rubocop/rake_task'
Expand Down
1 change: 1 addition & 0 deletions bin/msync
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

if ENV['COVERAGE']
# This block allow us to grab code coverage when running this script.
Expand Down
2 changes: 2 additions & 0 deletions features/step_definitions/git_steps.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require_relative '../../spec/helpers/faker/puppet_module_remote_repo'

Given 'a basic setup with a puppet module {string} from {string}' do |name, namespace|
Expand Down
2 changes: 2 additions & 0 deletions features/support/env.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'simplecov'

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

require 'English'
require 'fileutils'
require 'pathname'
Expand Down
2 changes: 2 additions & 0 deletions lib/modulesync/cli.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'thor'

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

require 'thor'
require 'modulesync/cli'

Expand Down
12 changes: 7 additions & 5 deletions lib/modulesync/constants.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# frozen_string_literal: true

module ModuleSync
module Constants
MODULE_FILES_DIR = 'moduleroot/'.freeze
CONF_FILE = 'config_defaults.yml'.freeze
MODULE_CONF_FILE = '.sync.yml'.freeze
MODULESYNC_CONF_FILE = 'modulesync.yml'.freeze
HOOK_FILE = '.git/hooks/pre-push'.freeze
MODULE_FILES_DIR = 'moduleroot/'
CONF_FILE = 'config_defaults.yml'
MODULE_CONF_FILE = '.sync.yml'
MODULESYNC_CONF_FILE = 'modulesync.yml'
HOOK_FILE = '.git/hooks/pre-push'
GLOBAL_DEFAULTS_KEY = :global
end
end
2 changes: 2 additions & 0 deletions lib/modulesync/git_service.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module ModuleSync
class Error < StandardError; end

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

module ModuleSync
module GitService
# Generic class for git services
Expand Down
2 changes: 2 additions & 0 deletions lib/modulesync/git_service/factory.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module ModuleSync
module GitService
# Git service's factory
Expand Down
2 changes: 2 additions & 0 deletions lib/modulesync/git_service/github.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'modulesync/git_service'
require 'modulesync/git_service/base'
require 'octokit'
Expand Down
2 changes: 2 additions & 0 deletions lib/modulesync/git_service/gitlab.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'gitlab'
require 'modulesync/git_service'
require 'modulesync/git_service/base'
Expand Down
2 changes: 2 additions & 0 deletions lib/modulesync/hook.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'modulesync'

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

require 'puppet_blacksmith'

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

require 'erb'
require 'find'

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

require 'git'

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

module ModuleSync
# Encapsulate a configs for a module, providing easy access to its parts
# All configs MUST be keyed by the relative target filename
Expand Down
2 changes: 2 additions & 0 deletions lib/modulesync/source_code.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'modulesync'
require 'modulesync/git_service'
require 'modulesync/git_service/factory'
Expand Down
2 changes: 2 additions & 0 deletions lib/modulesync/util.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'yaml'

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

module Git
module LibMonkeyPatch
# Monkey patch set_custom_git_env_variables due to our ::Git::GitExecuteError handling.
Expand Down
2 changes: 2 additions & 0 deletions modulesync.gemspec
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

lib = File.expand_path('lib', __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)

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

module ModuleSync
# Faker is a top-level module to keep global faker config
module Faker
Expand Down
2 changes: 2 additions & 0 deletions spec/helpers/faker/puppet_module_remote_repo.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'open3'

require_relative '../faker'
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

require 'simplecov'

require 'modulesync'
2 changes: 2 additions & 0 deletions spec/unit/module_sync/git_service/factory_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'modulesync'
require 'modulesync/git_service/factory'

Expand Down
2 changes: 2 additions & 0 deletions spec/unit/module_sync/git_service/github_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

require 'modulesync/git_service/github'
Expand Down
2 changes: 2 additions & 0 deletions spec/unit/module_sync/git_service/gitlab_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

require 'modulesync/git_service/gitlab'
Expand Down
2 changes: 2 additions & 0 deletions spec/unit/module_sync/git_service_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'modulesync'
require 'modulesync/git_service'

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

require 'spec_helper'

describe ModuleSync::Settings do
Expand Down
2 changes: 2 additions & 0 deletions spec/unit/module_sync/source_code_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

describe ModuleSync::SourceCode do
Expand Down
2 changes: 2 additions & 0 deletions spec/unit/module_sync_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

describe ModuleSync do
Expand Down