diff options
| author | Isabell Long | 2017-06-17 07:12:46 +0100 |
|---|---|---|
| committer | Isabell Long | 2017-10-29 15:19:31 +0000 |
| commit | 640b1e9dcb3fb96f6a54c0d63da4fb1985351a83 (patch) | |
| tree | 7fb90fc0d65312ec327b6d9034463c3375180f2a /Library/Homebrew/test | |
| parent | 7caca570736a6232512328992b398270dbbf3f4f (diff) | |
| download | brew-640b1e9dcb3fb96f6a54c0d63da4fb1985351a83.tar.bz2 | |
formula_desc_cop: ensure no full stops at the end of desc
- This was a suggestion by Mike McQuaid in my `homebrew-core` audit
description PR. Based on ilovezfs's incantation `grep -r -E 'desc
".*\."' *.rb`, some formulae descriptions do end in full stops. (My
initial assessment of this failed to account for the fact that
descriptions are strings and so end in `"`.)
- Add an autocorrect for this cop, too.
Diffstat (limited to 'Library/Homebrew/test')
| -rw-r--r-- | Library/Homebrew/test/rubocops/formula_desc_cop_spec.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Library/Homebrew/test/rubocops/formula_desc_cop_spec.rb b/Library/Homebrew/test/rubocops/formula_desc_cop_spec.rb index 3ddc42d34..aacb52ebb 100644 --- a/Library/Homebrew/test/rubocops/formula_desc_cop_spec.rb +++ b/Library/Homebrew/test/rubocops/formula_desc_cop_spec.rb @@ -91,6 +91,16 @@ describe RuboCop::Cop::FormulaAuditStrict::Desc do RUBY end + it "When the description ends with a full stop" do + expect_offense(<<~RUBY, "/homebrew-core/Formula/foo.rb") + class Foo < Formula + url 'http://example.com/foo-1.0.tgz' + desc 'Description with a full stop at the end.' + ^ Description shouldn\'t end with a full stop + end + RUBY + end + it "autocorrects all rules" do source = <<~EOS class Foo < Formula |
