From 9662c935c32dff98d976c9a208dbd2c9534efa9e Mon Sep 17 00:00:00 2001 From: Olle Jonsson Date: Mon, 18 Sep 2017 21:04:10 +0200 Subject: [PATCH] RuboCop 0.50.0; lints --- .rubocop.yml | 9 +++++++-- Gemfile | 2 +- github_changelog_generator.gemspec | 1 - .../generator/generator_fetcher.rb | 2 +- lib/github_changelog_generator/parser.rb | 2 +- lib/github_changelog_generator/parser_file.rb | 2 +- 6 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 69a81c4..80b1a04 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -26,7 +26,7 @@ Metrics/ClassLength: Metrics/MethodLength: Enabled: false -Style/FileName: +Naming/FileName: Exclude: - 'bin/git-generate-changelog' @@ -36,7 +36,7 @@ Metrics/AbcSize: Enabled: false # Offense count: 1 -Style/AccessorMethodName: +Naming/AccessorMethodName: Enabled: false # Offense count: 10 @@ -75,3 +75,8 @@ Style/SafeNavigation: Metrics/BlockLength: Exclude: - 'spec/**/*' + +# Re-enable when merged; https://github.com/bbatsov/rubocop/pull/4756 +Lint/InterpolationCheck: + Enabled: false + diff --git a/Gemfile b/Gemfile index 685e152..98a0296 100644 --- a/Gemfile +++ b/Gemfile @@ -10,7 +10,7 @@ group :development, :test do gem "bundler" gem "overcommit", ">= 0.31" gem "rake" - gem "rubocop", ">= 0.43" + gem "rubocop", ">= 0.50" end group :development do diff --git a/github_changelog_generator.gemspec b/github_changelog_generator.gemspec index 164cdbb..40c748b 100644 --- a/github_changelog_generator.gemspec +++ b/github_changelog_generator.gemspec @@ -1,4 +1,3 @@ -# coding: utf-8 # frozen_string_literal: true lib = File.expand_path("../lib", __FILE__) diff --git a/lib/github_changelog_generator/generator/generator_fetcher.rb b/lib/github_changelog_generator/generator/generator_fetcher.rb index 9c16d8f..a96020b 100644 --- a/lib/github_changelog_generator/generator/generator_fetcher.rb +++ b/lib/github_changelog_generator/generator/generator_fetcher.rb @@ -78,7 +78,7 @@ module GitHubChangelogGenerator issue["actual_date"] = commit["commit"]["author"]["date"] # issue['actual_date'] = commit['author']['date'] - rescue + rescue StandardError puts "Warning: Can't fetch commit #{event['commit_id']}. It is probably referenced from another repo." issue["actual_date"] = issue["closed_at"] end diff --git a/lib/github_changelog_generator/parser.rb b/lib/github_changelog_generator/parser.rb index 7268b89..dd0c1ba 100755 --- a/lib/github_changelog_generator/parser.rb +++ b/lib/github_changelog_generator/parser.rb @@ -277,7 +277,7 @@ module GitHubChangelogGenerator begin param = match[2].nil? - rescue + rescue StandardError puts "Can't detect user and name from first parameter: '#{arg0}' -> exit'" return end diff --git a/lib/github_changelog_generator/parser_file.rb b/lib/github_changelog_generator/parser_file.rb index c5dc93f..e2a80d7 100644 --- a/lib/github_changelog_generator/parser_file.rb +++ b/lib/github_changelog_generator/parser_file.rb @@ -48,7 +48,7 @@ module GitHubChangelogGenerator return if non_configuration_line?(line) option_name, value = extract_pair(line) @options[option_key_for(option_name)] = convert_value(value, option_name) - rescue + rescue StandardError raise ParserError, "Failed on line ##{line_number}: \"#{line.gsub(/[\n\r]+/, '')}\"" end