Skip to content

Commit

Permalink
feat: Require Ruby 3.0 and support new checks as of Rubocop 1.63 (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
dazuma authored Apr 24, 2024
1 parent 14a7d83 commit bc566bf
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 9 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@ jobs:
strategy:
matrix:
include:
- os: ubuntu-latest
ruby: "2.7"
- os: ubuntu-latest
ruby: "3.0"
- os: ubuntu-latest
ruby: "3.1"
- os: ubuntu-latest
ruby: "3.2"
- os: ubuntu-latest
ruby: "3.3"
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
uses: actions/checkout@v4
- name: Install Ruby ${{ matrix.ruby }}
uses: ruby/setup-ruby@v1
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ jobs:
RELEASE_PLEASE_DISABLE: ${{ secrets.RELEASE_PLEASE_DISABLE }}
steps:
- name: Checkout repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- name: Install Ruby 3.0
uses: actions/checkout@v4
- name: Install Ruby 3.3
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.0"
ruby-version: "3.3"
- name: Install NodeJS 16.x
uses: actions/setup-node@v4
with:
Expand Down
4 changes: 2 additions & 2 deletions google-style.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Gem::Specification.new do |gem|
"README.md", "google-style.yml",
"lib/google/style/version.rb"]

gem.required_ruby_version = ">= 2.7.0"
gem.required_ruby_version = ">= 3.0.0"

gem.add_dependency "rubocop", "~> 1.56"
gem.add_dependency "rubocop", "~> 1.63"
end
22 changes: 21 additions & 1 deletion google-style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
AllCops:
NewCops: disable
SuggestExtensions: false
TargetRubyVersion: 2.7
TargetRubyVersion: 3.0

# Added in Rubocop 1.30
Gemspec/DeprecatedAttributeAssignment:
Expand Down Expand Up @@ -120,10 +120,18 @@ Lint/EmptyInPattern:
Lint/IncompatibleIoSelectWithFiberScheduler:
Enabled: true

# Added in Rubocop 1.59
Lint/ItWithoutArgumentsInBlock:
Enabled: true

# Added in Rubocop 1.8
Lint/LambdaWithoutLiteralBlock:
Enabled: true

# Added in Rubocop 1.58
Lint/LiteralAssignmentInCondition:
Enabled: true

# Added in Rubocop 1.53
Lint/MixedCaseRange:
Enabled: true
Expand Down Expand Up @@ -345,6 +353,10 @@ Style/MagicCommentFormat:
Style/MapCompactWithConditionalBlock:
Enabled: true

# Added in Rubocop 1.63
Style/MapIntoArray:
Enabled: true

# Added in Rubocop 1.24
Style/MapToHash:
Enabled: true
Expand Down Expand Up @@ -504,6 +516,10 @@ Style/ReturnNilInPredicateMethodDefinition:
Style/SelectByRegexp:
Enabled: false

# Added in Rubocop 1.57
Style/SingleLineDoEndBlock:
Enabled: true

# Added in Rubocop 1.12
Style/StringChars:
Enabled: true
Expand All @@ -512,6 +528,10 @@ Style/StringChars:
Style/StringLiterals:
EnforcedStyle: double_quotes

# We prefer omitting parentheses where possible.
Style/SuperWithArgsParentheses:
Enabled: false

# Added in Rubocop 1.1
Style/SwapValues:
Enabled: true
Expand Down

0 comments on commit bc566bf

Please sign in to comment.