diff options
author | David Rodríguez <deivid.rodriguez@riseup.net> | 2019-03-28 16:46:13 +0100 |
---|---|---|
committer | David Rodríguez <deivid.rodriguez@riseup.net> | 2019-03-29 18:02:38 +0100 |
commit | b09ff4e3bf86a9011da3f5735efae016ff6f1f67 (patch) | |
tree | 193acb1c9d03b5bc662c5bd4543795eee23f341b | |
parent | ec9766b7dc53122ec2c3426cb3a4b5a331c89f2d (diff) | |
download | bundler-remove_gem_build_warning_exception.tar.gz |
Check for straneous quotesremove_gem_build_warning_exception
-rw-r--r-- | lib/bundler/templates/newgem/README.md.tt | 2 | ||||
-rw-r--r-- | lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb | 12 | ||||
-rw-r--r-- | spec/quality_spec.rb | 26 |
3 files changed, 33 insertions, 7 deletions
diff --git a/lib/bundler/templates/newgem/README.md.tt b/lib/bundler/templates/newgem/README.md.tt index 22ddeaa91a..59218dd8ae 100644 --- a/lib/bundler/templates/newgem/README.md.tt +++ b/lib/bundler/templates/newgem/README.md.tt @@ -43,5 +43,5 @@ The gem is available as open source under the terms of the [MIT License](https:/ ## Code of Conduct -Everyone interacting in the <%= config[:constant_name] %> project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/<%= config[:github_username] %>/<%= config[:name] %>/blob/master/CODE_OF_CONDUCT.md). +Everyone interacting in the <%= config[:constant_name] %> project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/<%= config[:github_username] %>/<%= config[:name] %>/blob/master/CODE_OF_CONDUCT.md). <% end -%> diff --git a/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb b/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb index 0eb665d17a..d8e782dd74 100644 --- a/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +++ b/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb @@ -524,12 +524,12 @@ module Bundler::Molinillo possible_binding_requirements = conflict.requirements.values.flatten(1).uniq - # When there’s a `CircularDependency` error the conflicting requirement - # (the one causing the circular) won’t be `conflict.requirement` - # (which won’t be for the right state, because we won’t have created it, - # because it’s circular). - # We need to make sure we have that requirement in the conflict’s list, - # otherwise we won’t be able to unwind properly, so we just return all + # When there's a `CircularDependency` error the conflicting requirement + # (the one causing the circular) won't be `conflict.requirement` + # (which won't be for the right state, because we won't have created it, + # because it's circular). + # We need to make sure we have that requirement in the conflict's list, + # otherwise we won't be able to unwind properly, so we just return all # the requirements for the conflict. return possible_binding_requirements if conflict.underlying_error diff --git a/spec/quality_spec.rb b/spec/quality_spec.rb index 02076c89b0..75db5f0e54 100644 --- a/spec/quality_spec.rb +++ b/spec/quality_spec.rb @@ -59,6 +59,19 @@ RSpec.describe "The library itself" do "#{filename} has spaces on the EOL on lines #{failing_lines.join(", ")}" end + def check_for_straneous_quotes(filename) + return if filename == __FILE__ + + failing_lines = [] + each_line(filename) do |line, number| + next if line =~ /’/ + failing_lines << number + 1 if line =~ /\s+\n$/ + end + + return if failing_lines.empty? + "#{filename} has an straneous quote on lines #{failing_lines.join(", ")}" + end + def check_for_expendable_words(filename) failing_line_message = [] useless_words = %w[ @@ -106,6 +119,19 @@ RSpec.describe "The library itself" do expect(error_messages.compact).to be_well_formed end + it "has no estraneous quotes" do + exempt = /vcr_cassettes|LICENSE|rbreadline\.diff/ + error_messages = [] + Dir.chdir(root) do + files = ruby_core? ? `git ls-files -z -- lib/bundler lib/bundler.rb spec/bundler` : `git ls-files -z` + files.split("\x0").each do |filename| + next if filename =~ exempt + error_messages << check_for_straneous_quotes(filename) + end + end + expect(error_messages.compact).to be_well_formed + end + it "does not include any leftover debugging or development mechanisms" do exempt = %r{quality_spec.rb|support/helpers|vcr_cassettes|\.md|\.ronn} error_messages = [] |