mirror of
https://github.com/glitch-soc/mastodon
synced 2025-04-25 00:44:51 +00:00
Add rubocop-i18n linter (#34057)
This commit is contained in:
parent
37b79c638f
commit
15da6c3c83
5 changed files with 21 additions and 2 deletions
|
@ -18,6 +18,7 @@ inherit_from:
|
||||||
- .rubocop/rspec_rails.yml
|
- .rubocop/rspec_rails.yml
|
||||||
- .rubocop/rspec.yml
|
- .rubocop/rspec.yml
|
||||||
- .rubocop/style.yml
|
- .rubocop/style.yml
|
||||||
|
- .rubocop/i18n.yml
|
||||||
- .rubocop/custom.yml
|
- .rubocop/custom.yml
|
||||||
- .rubocop_todo.yml
|
- .rubocop_todo.yml
|
||||||
- .rubocop/strict.yml
|
- .rubocop/strict.yml
|
||||||
|
@ -30,6 +31,7 @@ plugins:
|
||||||
- rubocop-rails
|
- rubocop-rails
|
||||||
- rubocop-rspec
|
- rubocop-rspec
|
||||||
- rubocop-performance
|
- rubocop-performance
|
||||||
|
- rubocop-i18n
|
||||||
|
|
||||||
require:
|
require:
|
||||||
- rubocop-rspec_rails
|
- rubocop-rspec_rails
|
||||||
|
|
12
.rubocop/i18n.yml
Normal file
12
.rubocop/i18n.yml
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
I18n/RailsI18n:
|
||||||
|
Enabled: true
|
||||||
|
Exclude:
|
||||||
|
- 'config/**/*'
|
||||||
|
- 'db/**/*'
|
||||||
|
- 'lib/**/*'
|
||||||
|
- 'spec/**/*'
|
||||||
|
I18n/GetText:
|
||||||
|
Enabled: false
|
||||||
|
|
||||||
|
I18n/RailsI18n/DecorateStringFormattingUsingInterpolation:
|
||||||
|
Enabled: false
|
1
Gemfile
1
Gemfile
|
@ -165,6 +165,7 @@ group :development do
|
||||||
# Code linting CLI and plugins
|
# Code linting CLI and plugins
|
||||||
gem 'rubocop', require: false
|
gem 'rubocop', require: false
|
||||||
gem 'rubocop-capybara', require: false
|
gem 'rubocop-capybara', require: false
|
||||||
|
gem 'rubocop-i18n', require: false
|
||||||
gem 'rubocop-performance', require: false
|
gem 'rubocop-performance', require: false
|
||||||
gem 'rubocop-rails', require: false
|
gem 'rubocop-rails', require: false
|
||||||
gem 'rubocop-rspec', require: false
|
gem 'rubocop-rspec', require: false
|
||||||
|
|
|
@ -719,7 +719,7 @@ GEM
|
||||||
rspec-mocks (~> 3.0)
|
rspec-mocks (~> 3.0)
|
||||||
sidekiq (>= 5, < 8)
|
sidekiq (>= 5, < 8)
|
||||||
rspec-support (3.13.2)
|
rspec-support (3.13.2)
|
||||||
rubocop (1.73.1)
|
rubocop (1.73.2)
|
||||||
json (~> 2.3)
|
json (~> 2.3)
|
||||||
language_server-protocol (~> 3.17.0.2)
|
language_server-protocol (~> 3.17.0.2)
|
||||||
lint_roller (~> 1.1.0)
|
lint_roller (~> 1.1.0)
|
||||||
|
@ -734,6 +734,9 @@ GEM
|
||||||
parser (>= 3.3.1.0)
|
parser (>= 3.3.1.0)
|
||||||
rubocop-capybara (2.21.0)
|
rubocop-capybara (2.21.0)
|
||||||
rubocop (~> 1.41)
|
rubocop (~> 1.41)
|
||||||
|
rubocop-i18n (3.2.3)
|
||||||
|
lint_roller (~> 1.1)
|
||||||
|
rubocop (>= 1.72.1)
|
||||||
rubocop-performance (1.24.0)
|
rubocop-performance (1.24.0)
|
||||||
lint_roller (~> 1.1)
|
lint_roller (~> 1.1)
|
||||||
rubocop (>= 1.72.1, < 2.0)
|
rubocop (>= 1.72.1, < 2.0)
|
||||||
|
@ -1016,6 +1019,7 @@ DEPENDENCIES
|
||||||
rspec-sidekiq (~> 5.0)
|
rspec-sidekiq (~> 5.0)
|
||||||
rubocop
|
rubocop
|
||||||
rubocop-capybara
|
rubocop-capybara
|
||||||
|
rubocop-i18n
|
||||||
rubocop-performance
|
rubocop-performance
|
||||||
rubocop-rails
|
rubocop-rails
|
||||||
rubocop-rspec
|
rubocop-rspec
|
||||||
|
|
|
@ -12,7 +12,7 @@ class VideoMetadataExtractor
|
||||||
rescue Terrapin::ExitStatusError, Oj::ParseError
|
rescue Terrapin::ExitStatusError, Oj::ParseError
|
||||||
@invalid = true
|
@invalid = true
|
||||||
rescue Terrapin::CommandNotFoundError
|
rescue Terrapin::CommandNotFoundError
|
||||||
raise Paperclip::Errors::CommandNotFoundError, 'Could not run the `ffprobe` command. Please install ffmpeg.'
|
raise Paperclip::Errors::CommandNotFoundError, 'Could not run the `ffprobe` command. Please install ffmpeg.' # rubocop:disable I18n/RailsI18n/DecorateString -- This error is not user-facing
|
||||||
end
|
end
|
||||||
|
|
||||||
def valid?
|
def valid?
|
||||||
|
|
Loading…
Add table
Reference in a new issue