Skip to content

Commit 1593165

Browse files
committed
Enforce frozen_string_literal and add performance cops
Every file in this project already uses `# frozen_string_literal: true` but the linter never enforced it, so new files could silently omit the comment. Enable the Style/FrozenStringLiteralComment cop via standardrb's extend_config mechanism to make the existing convention a hard rule. Also add rubocop-performance to catch common performance anti-patterns like inefficient string operations and unnecessary object allocations.
1 parent e7eaea5 commit 1593165

3 files changed

Lines changed: 12 additions & 0 deletions

File tree

.rubocop_extra.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
require:
2+
- rubocop-performance
3+
4+
Style/FrozenStringLiteralComment:
5+
Enabled: true
6+
EnforcedStyle: always
7+
8+
Performance:
9+
Enabled: true

.standard.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
ruby_version: 3.3.0
2+
extend_config:
3+
- .rubocop_extra.yml

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ gem "rake", "~> 13.0"
99
gem "rspec", "~> 3.0"
1010
gem "stackprof"
1111
gem "standard"
12+
gem "rubocop-performance"
1213
gem "ruby-prof"
1314

1415
gem "benchmark"

0 commit comments

Comments
 (0)