Skip to content

Commit dc96477

Browse files
committed
rubocop
1 parent 6e06e16 commit dc96477

6 files changed

Lines changed: 11 additions & 10 deletions

File tree

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ group :jekyll_plugins do
1111
end
1212

1313
group :development, :test do
14-
gem 'html-proofer', "~> 4.0"
14+
gem 'html-proofer', '~> 4.0'
1515
gem 'parallel'
1616
gem 'rake'
1717
gem 'rubocop'

Rakefile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@ task :test do
1010
check_external_hash: false,
1111
hydra: { max_concurrency: 10 },
1212
url_ignore: [%r{https://developer.github.com}, %r{https://docs.github.com}, %r{https://help.github.com}],
13-
ignore_status_codes: [429])
14-
token = ENV['GITHUB_TOKEN']
15-
if defined? token
13+
ignore_status_codes: [429]
14+
)
15+
token = ENV.fetch('GITHUB_TOKEN', nil)
16+
unless token.nil?
1617
proofer.before_request do |request|
17-
request.options[:headers]['Authorization'] = "Bearer #{token}" if request.base_url == "https://github.com"
18+
request.options[:headers]['Authorization'] = "Bearer #{token}" if request.base_url == 'https://github.com'
1819
end
1920
end
2021
proofer.run

script/alphabetize

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ require 'yaml'
1010
files = Dir["#{File.expand_path('../_data/', File.dirname(__FILE__))}/*.yml"]
1111

1212
files.each do |file|
13-
contents = File.open(file).read
13+
contents = File.read(file)
1414
comment = contents.lines.first
1515

1616
data = YAML.safe_load(contents)
@@ -25,5 +25,5 @@ files.each do |file|
2525
# Add extra line break between groups, indent arrays, and strip header
2626
formatted_output = comment + output.to_yaml.gsub(/^(.+?):$/, "\n\\1:").gsub(/^- /, ' - ').gsub(/\A---\n/m, '')
2727

28-
File.open(file, 'w') { |f| f.write(formatted_output) }
28+
File.write(file, formatted_output)
2929
end

script/ensure-orgs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ files.each do |file|
4848
data[group] = data[group] - not_orgs
4949
end
5050

51-
comment = File.open(file).read.lines.first
51+
comment = File.read(file).lines.first
5252
output = comment
5353
output << "\n"
5454
output << data.to_yaml.sub(/\A---\n/, '').gsub(/^-/, ' -').gsub(/\n([^ ])/, "\n\n\\1")

script/fetch-cfa

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ module CFA
3131
org_file['Code for All'] = code_for_all_orgs
3232
org_file['Civic Hackers'] = civic_hackers - brigades - code_for_all_orgs + to_be_removed
3333

34-
comment = File.open(org_file_path).read.lines.first
34+
comment = File.read(org_file_path).lines.first
3535
output = comment
3636
output << "\n"
3737
output << org_file.to_yaml.sub(/\A---\n/, '').gsub(/^-/, ' -').gsub(/\n([^ ])/, "\n\n\\1")

script/fetch-us

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ org_file['U.S. Federal'] = org_file['U.S. Federal'].uniq.sort_by(&:upcase)
4747
puts "\n\nMissing from registry:"
4848
puts((us_gov - orgs.map(&:downcase)).to_yaml)
4949

50-
comment = File.open(org_file_path).read.lines.first
50+
comment = File.read(org_file_path).lines.first
5151
output = comment
5252
output << "\n"
5353
output << org_file.to_yaml.sub(/\A---\n/, '').gsub(/^-/, ' -').gsub(/\n([^ ])/, "\n\n\\1")

0 commit comments

Comments
 (0)