Skip to content

Commit

Permalink
Configure rubocops for linting
Browse files Browse the repository at this point in the history
  • Loading branch information
erickguan committed Mar 2, 2024
1 parent 5e0038b commit 8733ac9
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 2 deletions.
56 changes: 56 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
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
6 changes: 4 additions & 2 deletions ffi-icu.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,22 @@ 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"
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
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_runtime_dependency "bigdecimal", "~> 3.1"

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

0 comments on commit 8733ac9

Please sign in to comment.