diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 0000000..15f4d06 --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,60 @@ +require: + - rubocop-minitest + - rubocop-packaging + +AllCops: + NewCops: enable + StyleGuideBaseURL: https://rubystyle.guide + +Bundler/OrderedGems: { Include: ['*.gemspec'] } + +# Documentation +Style/Documentation: + Enabled: false + +# Allow more flexibility with string literals +Style/StringLiterals: + Enabled: true + EnforcedStyle: single_quotes + +# Enforce dots on the next line for multi-line method calls +Layout/DotPosition: + EnforcedStyle: trailing + +Layout/LineLength: + Max: 120 + +# Enforce comma after the last item of a multiline array or hash +Style/TrailingCommaInArrayLiteral: + EnforcedStyleForMultiline: comma + +Style/TrailingCommaInHashLiteral: + EnforcedStyleForMultiline: comma + +# Encourage the use of method call with args parentheses +Style/MethodCallWithArgsParentheses: + Enabled: true + EnforcedStyle: require_parentheses + +# Allow guard clauses +Style/GuardClause: + Enabled: true + +Style/FrozenStringLiteralComment: + Enabled: false + +Layout/EmptyLineAfterMagicComment: + Enabled: true + +# Exclude test files from BlockComments check +Style/BlockComments: + Exclude: + - 'test/**/*' + +# Naming conventions +Naming/PredicateName: + Enabled: true + +# Allow private methods to be placed after public methods of the same category +Layout/EmptyLinesAroundAccessModifier: + EnforcedStyle: only_before diff --git a/ffi-icu.gemspec b/ffi-icu.gemspec index a2eb8f8..ca57819 100644 --- a/ffi-icu.gemspec +++ b/ffi-icu.gemspec @@ -17,7 +17,7 @@ Gem::Specification.new do |spec| spec.metadata["source_code_uri"] = spec.homepage spec.metadata["changelog_uri"] = "#{spec.homepage}/blob/master/CHANGELOG.md" - spec.files = `git ls-files -z`.split("\x0").reject do |f| + spec.files = `git ls-files -z`.split("\x0").reject do |f| f.match(%r{^(test|spec|features)/}) end spec.bindir = "bin" @@ -25,11 +25,13 @@ Gem::Specification.new do |spec| spec.require_paths = ["lib"] spec.extra_rdoc_files = ["LICENSE", "README.md"] - spec.rdoc_options = ["--charset=UTF-8"] + spec.rdoc_options = ["--charset=UTF-8"] spec.add_runtime_dependency "ffi", "~> 1.0", ">= 1.0.9" spec.add_development_dependency "rspec", "~> 3.9" spec.add_development_dependency "rake", ">= 12.3.3" spec.add_development_dependency "rubocop", "~> 1.60" + spec.add_development_dependency "rubocop-minitest", "~> 0.34.5" + spec.add_development_dependency "rubocop-packaging", "~> 0.5.2" end