Skip to content

Commit

Permalink
use new rubocop (v3) style guide on openstudio resources s3
Browse files Browse the repository at this point in the history
  • Loading branch information
nllong committed May 9, 2020
1 parent 7de168b commit e07a3dc
Show file tree
Hide file tree
Showing 19 changed files with 10 additions and 44 deletions.
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ AllCops:
- lib/openstudio/extension/core/**/*

inherit_from:
- http://s3.amazonaws.com/openstudio-resources/styles/rubocop.yml
- http://s3.amazonaws.com/openstudio-resources/styles/rubocop_v3.yml

2 changes: 0 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# frozen_string_literal: true

source 'http://rubygems.org'

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

########################################################################################################################
# openstudio(R), Copyright (c) 2008-2020, Alliance for Sustainable Energy, LLC. All rights reserved.
#
Expand Down
1 change: 0 additions & 1 deletion bin/console
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

require 'bundler/setup'
require 'openstudio/extension'
Expand Down
1 change: 0 additions & 1 deletion lib/change_log.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

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

# *******************************************************************************
# OpenStudio(R), Copyright (c) 2008-2020, Alliance for Sustainable Energy, LLC.
# All rights reserved.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# frozen_string_literal: true

# *******************************************************************************
# OpenStudio(R), Copyright (c) 2008-2020, Alliance for Sustainable Energy, LLC.
# All rights reserved.
Expand Down
2 changes: 0 additions & 2 deletions lib/openstudio-extension.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# frozen_string_literal: true

# *******************************************************************************
# OpenStudio(R), Copyright (c) 2008-2020, Alliance for Sustainable Energy, LLC.
# All rights reserved.
Expand Down
2 changes: 0 additions & 2 deletions lib/openstudio/extension.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# frozen_string_literal: true

# *******************************************************************************
# OpenStudio(R), Copyright (c) 2008-2020, Alliance for Sustainable Energy, LLC.
# All rights reserved.
Expand Down
4 changes: 1 addition & 3 deletions lib/openstudio/extension/rake_task.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# frozen_string_literal: true

# *******************************************************************************
# OpenStudio(R), Copyright (c) 2008-2020, Alliance for Sustainable Energy, LLC.
# All rights reserved.
Expand Down Expand Up @@ -177,7 +175,7 @@ def setup_subtasks(name)
results = bcl.search(keyword, "fq[]=bundle:nrel_measure&show_rows=#{num_results}", false)
puts "there are #{results[:result].count} results"
results[:result].each do |res|
puts (res[:measure][:name]).to_s
puts(res[:measure][:name]).to_s
end
end

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

# *******************************************************************************
# OpenStudio(R), Copyright (c) 2008-2020, Alliance for Sustainable Energy, LLC.
# All rights reserved.
Expand Down Expand Up @@ -563,12 +561,12 @@ def update_copyright(root_dir, doc_templates_dir)
puts "Encoding.default_internal = #{Encoding.default_internal}"

paths.each do |path|
Dir[path[:glob]].each do |file|
puts "Updating license in file #{file}"
f = File.read(file)
Dir[path[:glob]].each do |dir_file|
puts "Updating license in file #{dir_file}"
f = File.read(dir_file)
if f.match?(path[:regex])
puts ' License found -- updating'
File.open(file, 'w') { |write| write << f.gsub(path[:regex], path[:license]) }
File.open(dir_file, 'w') { |write| write << f.gsub(path[:regex], path[:license]) }
elsif f =~ /\(C\)/i || f =~ /\(Copyright\)/i
puts ' File already has copyright -- skipping'
else
Expand All @@ -577,7 +575,7 @@ def update_copyright(root_dir, doc_templates_dir)
puts ' CANNOT add license to file automatically, add it manually and it will update automatically in the future'
next
end
File.open(file, 'w') { |write| write << f.insert(0, path[:license] + "\n") }
File.open(dir_file, 'w') { |write| write << f.insert(0, path[:license] + "\n") }
end
end
end
Expand Down
4 changes: 1 addition & 3 deletions lib/openstudio/extension/runner_config.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# frozen_string_literal: true

# *******************************************************************************
# OpenStudio(R), Copyright (c) 2008-2020, Alliance for Sustainable Energy, LLC.
# All rights reserved.
Expand Down Expand Up @@ -40,7 +38,7 @@
module OpenStudio
module Extension
class RunnerConfig
FILENAME = 'runner.conf'
FILENAME = 'runner.conf'.freeze

##
# Class to store configuration of the runner options.
Expand Down
4 changes: 1 addition & 3 deletions lib/openstudio/extension/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# frozen_string_literal: true

# *******************************************************************************
# OpenStudio(R), Copyright (c) 2008-2020, Alliance for Sustainable Energy, LLC.
# All rights reserved.
Expand Down Expand Up @@ -37,6 +35,6 @@

module OpenStudio
module Extension
VERSION = '0.2.2'
VERSION = '0.2.2'.freeze
end
end
4 changes: 1 addition & 3 deletions openstudio-extension.gemspec
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# frozen_string_literal: true

lib = File.expand_path('lib', __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'openstudio/extension/version'
Expand Down Expand Up @@ -30,7 +28,7 @@ Gem::Specification.new do |spec|

spec.required_ruby_version = '~> 2.5.0'

spec.add_dependency 'bcl', '~> 0.6.0'
spec.add_dependency 'bcl', '~> 0.6.1'
spec.add_dependency 'bundler', '~> 2.1'
spec.add_dependency 'octokit', '~> 4.18.0' # for change logs
spec.add_dependency 'openstudio-workflow', '~> 2.0.0'
Expand Down
2 changes: 0 additions & 2 deletions spec/openstudio/core/os_lib_geometry_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# frozen_string_literal: true

# *******************************************************************************
# OpenStudio(R), Copyright (c) 2008-2020, Alliance for Sustainable Energy, LLC.
# All rights reserved.
Expand Down
2 changes: 0 additions & 2 deletions spec/openstudio/extension_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# frozen_string_literal: true

# *******************************************************************************
# OpenStudio(R), Copyright (c) 2008-2020, Alliance for Sustainable Energy, LLC.
# All rights reserved.
Expand Down
2 changes: 0 additions & 2 deletions spec/openstudio/runner_config_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# frozen_string_literal: true

# *******************************************************************************
# OpenStudio(R), Copyright (c) 2008-2020, Alliance for Sustainable Energy, LLC.
# All rights reserved.
Expand Down
2 changes: 0 additions & 2 deletions spec/openstudio/runner_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# frozen_string_literal: true

# *******************************************************************************
# OpenStudio(R), Copyright (c) 2008-2020, Alliance for Sustainable Energy, LLC.
# All rights reserved.
Expand Down
2 changes: 0 additions & 2 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# frozen_string_literal: true

# *******************************************************************************
# OpenStudio(R), Copyright (c) 2008-2020, Alliance for Sustainable Energy, LLC.
# All rights reserved.
Expand Down

0 comments on commit e07a3dc

Please sign in to comment.