aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMarkus Reiter2016-09-20 19:36:32 +0200
committerMarkus Reiter2016-09-23 15:30:05 +0200
commita5f050245e1d10654c3f90e1df30de56f49b059e (patch)
treeb0b17e2d99f1a5f9a12d8433ac063ecf31f1b244 /Library
parent59212445da7048233ef32705433e548783fcf84b (diff)
downloadbrew-a5f050245e1d10654c3f90e1df30de56f49b059e.tar.bz2
Add Regex for `Style/FileName` cop.
Diffstat (limited to 'Library')
-rw-r--r--Library/.rubocop_rules.yml10
-rw-r--r--Library/Homebrew/cask/.rubocop.yml2
2 files changed, 8 insertions, 4 deletions
diff --git a/Library/.rubocop_rules.yml b/Library/.rubocop_rules.yml
index cde310930..88e0e25e6 100644
--- a/Library/.rubocop_rules.yml
+++ b/Library/.rubocop_rules.yml
@@ -98,10 +98,14 @@ Style/IfUnlessModifier:
Enabled: false
# dashes in filenames are typical
-# TODO: enforce when rubocop has fixed this
-# https://github.com/bbatsov/rubocop/issues/1545
Style/FileName:
- Enabled: false
+ # matches:
+ # file_name.rb (default)
+ # file-name.rb, --filename.rb (command names)
+ # FILENAME.rb (ARGV and ENV)
+ # does not match:
+ # dashes-and_underscores.rb
+ Regex: !ruby/regexp /^((([\dA-Z]+|[\da-z]+)(_([\dA-Z]+|[\da-z]+))*|(\-\-)?([\dA-Z]+|[\da-z]+)(-([\dA-Z]+|[\da-z]+))*))(\.rb)?$/
# no percent word array, being friendly to non-ruby users
# TODO: enforce when rubocop has fixed this
diff --git a/Library/Homebrew/cask/.rubocop.yml b/Library/Homebrew/cask/.rubocop.yml
index 7ba758a90..770b8728e 100644
--- a/Library/Homebrew/cask/.rubocop.yml
+++ b/Library/Homebrew/cask/.rubocop.yml
@@ -91,7 +91,7 @@ Style/Documentation:
Enabled: false
Style/FileName:
- Enabled: false
+ Regex: !ruby/regexp /^((([\dA-Z]+|[\da-z]+)(_([\dA-Z]+|[\da-z]+))*|(\-\-)?([\dA-Z]+|[\da-z]+)(-([\dA-Z]+|[\da-z]+))*))(\.rb)?$/
Style/HashSyntax:
EnforcedStyle: ruby19_no_mixed_keys