Add Regex for Style/FileName cop.

This commit is contained in:
Markus Reiter 2016-09-20 19:36:32 +02:00
parent 59212445da
commit a5f050245e
2 changed files with 8 additions and 4 deletions

View File

@ -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

View File

@ -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