Skip to content

Commit

Permalink
rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
grosser committed Sep 2, 2024
1 parent de5f22e commit 1b33f37
Show file tree
Hide file tree
Showing 6 changed files with 141 additions and 4 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
ruby: [ '2.5', '2.6', '2.7', '3.0', '3.1' ]
ruby: [ '3.0', '3.1', '3.2', '3.3' ]
task: [ 'spec' ]
include:
- ruby: '3.0' # keep in sync with rubocop.yml and gemspec
task: 'rubocop'
name: ${{ matrix.ruby }} rake
steps:
- uses: actions/checkout@v2
Expand Down
90 changes: 90 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
require:
- rubocop-rake
- rubocop-rspec

AllCops:
NewCops: enable
TargetRubyVersion: 3.0 # keep in sync with gemspec and actions.yml

Style/StringLiterals:
Enabled: false

Bundler/OrderedGems:
Enabled: false

Metrics:
Enabled: false

Style/Documentation:
Enabled: false

Layout/EmptyLineAfterMagicComment:
Enabled: false

Layout/EndAlignment:
EnforcedStyleAlignWith: variable

Layout/MultilineOperationIndentation:
Enabled: false

Layout/MultilineMethodCallIndentation:
EnforcedStyle: indented

Style/NumericPredicate:
EnforcedStyle: comparison

Layout/EmptyLineAfterGuardClause:
Enabled: false

Layout/FirstHashElementLineBreak:
Enabled: true # Opt-in

# Opt-in
Layout/FirstMethodArgumentLineBreak:
Enabled: true # Opt-in

Layout/FirstMethodParameterLineBreak:
Enabled: true # Opt-in

# https://github.com/rubocop-hq/rubocop/issues/5891
Style/SpecialGlobalVars:
Enabled: false

Style/WordArray:
EnforcedStyle: brackets

Style/SymbolArray:
EnforcedStyle: brackets

Style/GuardClause:
Enabled: false

Style/EmptyElse:
Enabled: false

RSpec/DescribedClass:
EnforcedStyle: explicit

Style/DoubleNegation:
Enabled: false

RSpec/VerifiedDoubles:
Enabled: false

RSpec/ExampleLength:
Enabled: false

Style/CombinableLoops:
Enabled: false

Lint/Void:
Enabled: false

Security/MarshalLoad:
Enabled: false

Lint/EmptyBlock:
Exclude: [spec/**/*.rb]

Naming/MethodParameterName:
Exclude: [spec/**/*.rb]
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ gemspec
gem 'bump'
gem 'rake'
gem 'rspec', '~>3.0'
gem 'rubocop'
gem 'rubocop-rake'
gem 'rubocop-rspec'
35 changes: 35 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,21 @@ PATH
GEM
remote: https://rubygems.org/
specs:
ast (2.4.2)
bump (0.10.0)
diff-lcs (1.4.4)
json (2.7.2)
language_server-protocol (3.17.0.3)
parallel (1.26.3)
parser (3.3.4.2)
ast (~> 2.4.1)
racc
racc (1.8.1)
rainbow (3.1.1)
rake (13.0.6)
regexp_parser (2.9.2)
rexml (3.3.6)
strscan
rspec (3.10.0)
rspec-core (~> 3.10.0)
rspec-expectations (~> 3.10.0)
Expand All @@ -23,7 +35,27 @@ GEM
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.10.0)
rspec-support (3.10.3)
rubocop (1.65.1)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 2.4, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.31.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.32.1)
parser (>= 3.3.1.0)
rubocop-rake (0.6.0)
rubocop (~> 1.0)
rubocop-rspec (2.9.0)
rubocop (~> 1.19)
ruby-progressbar (1.13.0)
simple_po_parser (1.1.6)
strscan (3.1.0)
unicode-display_width (2.5.0)

PLATFORMS
ruby
Expand All @@ -36,6 +68,9 @@ DEPENDENCIES
i18n_data!
rake
rspec (~> 3.0)
rubocop
rubocop-rake
rubocop-rspec

BUNDLED WITH
2.3.12
7 changes: 6 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,17 @@ require 'yaml'
$LOAD_PATH << "lib"
require 'i18n_data'

task default: [:spec]
task default: [:spec, :rubocop]

task :spec do
sh "rspec --warnings spec/"
end

desc "Rubocop"
task :rubocop do
sh "rubocop --parallel"
end

desc "write all languages to output"
task :all_languages do
I18nData.languages.keys.each do |lc|
Expand Down
4 changes: 2 additions & 2 deletions i18n_data.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ Gem::Specification.new name, I18nData::VERSION do |s|
s.homepage = "https://github.com/grosser/#{name}"
s.files = `git ls-files lib cache `.split("\n")
s.license = "MIT"
s.required_ruby_version = '>= 2.5.0'
s.add_runtime_dependency 'simple_po_parser', '~> 1.1'
s.required_ruby_version = '>= 3.0.0' # keep in sync with rubocop.yml and actions.yml
s.add_dependency 'simple_po_parser', '~> 1.1'
end

0 comments on commit 1b33f37

Please sign in to comment.