rubocop-i18n 2.0.2 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/ISSUE_TEMPLATE/bug_report.md +38 -0
- data/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
- data/.github/workflows/rubocop.yml +21 -0
- data/.rspec +1 -0
- data/.rubocop.yml +11 -0
- data/.rubocop_todo.yml +65 -37
- data/.ruby-version +1 -1
- data/CHANGELOG.md +14 -2
- data/CODE_OF_CONDUCT.md +11 -71
- data/Gemfile +9 -0
- data/README.md +24 -25
- data/Rakefile +1 -0
- data/config/default.yml +25 -0
- data/lib/rubocop/cop/i18n/gettext/decorate_function_message.rb +20 -19
- data/lib/rubocop/cop/i18n/gettext/decorate_string.rb +9 -12
- data/lib/rubocop/cop/i18n/gettext/decorate_string_formatting_using_interpolation.rb +1 -1
- data/lib/rubocop/cop/i18n/gettext/decorate_string_formatting_using_percent.rb +1 -1
- data/lib/rubocop/cop/i18n/rails_i18n/decorate_string.rb +3 -3
- data/lib/rubocop/cop/i18n/rails_i18n/decorate_string_formatting_using_interpolation.rb +1 -1
- data/lib/rubocop/cop/i18n_cops.rb +11 -0
- data/lib/rubocop/i18n/inject.rb +18 -0
- data/lib/rubocop/i18n.rb +11 -0
- data/lib/rubocop-i18n.rb +8 -1
- data/rubocop-i18n.gemspec +9 -11
- metadata +17 -104
- data/.travis.yml +0 -4
- data/CODEOWNERS +0 -5
- data/lib/rubocop/cop/i18n.rb +0 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a8757409734d4423d1eadc150b14ab3ea6d9ba9a0063dc9dd47de719e22ba5f3
|
4
|
+
data.tar.gz: 52a3962588122fbc261b91ab8a55b038640f169349d93e7f8ccf8e44dd4ec5ab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aeb2ba4d3bd6cc24d9f88ad0c74e910d0a2b6ab20328d890538f6b60451b0c6e1c92641726b925a6720beddff082e766cbd7a6d30881ad1078d2004b6b077346
|
7
|
+
data.tar.gz: a61d551a0ee9bb628c10b3e57b2ab8efffb84dcae53939203b9257fb6a92e4c1470df0348654382bbf788b238461ff7ff8f437108cb568644db5dc333af3ad71
|
@@ -0,0 +1,38 @@
|
|
1
|
+
---
|
2
|
+
name: Bug report
|
3
|
+
about: Create a report to help us improve
|
4
|
+
title: ''
|
5
|
+
labels: ''
|
6
|
+
assignees: ''
|
7
|
+
|
8
|
+
---
|
9
|
+
|
10
|
+
**Describe the bug**
|
11
|
+
A clear and concise description of what the bug is.
|
12
|
+
|
13
|
+
**To Reproduce**
|
14
|
+
Steps to reproduce the behavior:
|
15
|
+
1. Go to '...'
|
16
|
+
2. Click on '....'
|
17
|
+
3. Scroll down to '....'
|
18
|
+
4. See error
|
19
|
+
|
20
|
+
**Expected behavior**
|
21
|
+
A clear and concise description of what you expected to happen.
|
22
|
+
|
23
|
+
**Screenshots**
|
24
|
+
If applicable, add screenshots to help explain your problem.
|
25
|
+
|
26
|
+
**Desktop (please complete the following information):**
|
27
|
+
- OS: [e.g. iOS]
|
28
|
+
- Browser [e.g. chrome, safari]
|
29
|
+
- Version [e.g. 22]
|
30
|
+
|
31
|
+
**Smartphone (please complete the following information):**
|
32
|
+
- Device: [e.g. iPhone6]
|
33
|
+
- OS: [e.g. iOS8.1]
|
34
|
+
- Browser [e.g. stock browser, safari]
|
35
|
+
- Version [e.g. 22]
|
36
|
+
|
37
|
+
**Additional context**
|
38
|
+
Add any other context about the problem here.
|
@@ -0,0 +1,20 @@
|
|
1
|
+
---
|
2
|
+
name: Feature request
|
3
|
+
about: Suggest an idea for this project
|
4
|
+
title: ''
|
5
|
+
labels: ''
|
6
|
+
assignees: ''
|
7
|
+
|
8
|
+
---
|
9
|
+
|
10
|
+
**Is your feature request related to a problem? Please describe.**
|
11
|
+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
12
|
+
|
13
|
+
**Describe the solution you'd like**
|
14
|
+
A clear and concise description of what you want to happen.
|
15
|
+
|
16
|
+
**Describe alternatives you've considered**
|
17
|
+
A clear and concise description of any alternative solutions or features you've considered.
|
18
|
+
|
19
|
+
**Additional context**
|
20
|
+
Add any other context or screenshots about the feature request here.
|
@@ -0,0 +1,21 @@
|
|
1
|
+
name: Test
|
2
|
+
|
3
|
+
on: [push, pull_request]
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
rubocop:
|
7
|
+
runs-on: ubuntu-latest
|
8
|
+
strategy:
|
9
|
+
matrix:
|
10
|
+
ruby: [ '2.7.7' ]
|
11
|
+
steps:
|
12
|
+
- uses: actions/checkout@master
|
13
|
+
- name: Set up Ruby
|
14
|
+
uses: ruby/setup-ruby@v1
|
15
|
+
with:
|
16
|
+
ruby-version: ${{ matrix.ruby }}
|
17
|
+
bundler-cache: true
|
18
|
+
- name: Run rake default task
|
19
|
+
run: |
|
20
|
+
bundle install --jobs=3 --retry=3
|
21
|
+
bundle exec rake
|
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--require spec_helper
|
data/.rubocop.yml
CHANGED
@@ -1,6 +1,17 @@
|
|
1
1
|
inherit_from: .rubocop_todo.yml
|
2
2
|
require:
|
3
3
|
- rubocop/cop/internal_affairs
|
4
|
+
- rubocop-rake
|
5
|
+
- rubocop-rspec
|
6
|
+
- rubocop-performance
|
7
|
+
|
8
|
+
AllCops:
|
9
|
+
TargetRubyVersion: 2.5
|
10
|
+
NewCops: enable
|
11
|
+
|
12
|
+
# rubocop-i18n does not have config/default.
|
13
|
+
InternalAffairs/UndefinedConfig:
|
14
|
+
Enabled: false
|
4
15
|
|
5
16
|
Metrics/BlockLength:
|
6
17
|
Exclude:
|
data/.rubocop_todo.yml
CHANGED
@@ -1,46 +1,71 @@
|
|
1
1
|
# This configuration was generated by
|
2
2
|
# `rubocop --auto-gen-config`
|
3
|
-
# on
|
3
|
+
# on 2025-01-15 21:44:52 UTC using RuboCop version 1.70.0.
|
4
4
|
# The point is for the user to remove these configuration records
|
5
5
|
# one by one as the offenses are removed from the code base.
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
7
7
|
# versions of RuboCop, may require this file to be generated again.
|
8
8
|
|
9
|
-
# Offense count:
|
9
|
+
# Offense count: 1
|
10
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
10
11
|
Lint/InterpolationCheck:
|
11
12
|
Exclude:
|
12
|
-
- 'spec/rubocop/cop/i18n/
|
13
|
+
- 'spec/rubocop/cop/i18n/get_text/decorate_string_spec.rb'
|
13
14
|
|
14
|
-
# Offense count:
|
15
|
+
# Offense count: 3
|
16
|
+
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
|
15
17
|
Metrics/AbcSize:
|
16
|
-
Max:
|
17
|
-
|
18
|
-
# Offense count: 6
|
19
|
-
# Configuration parameters: CountComments, ExcludedMethods.
|
20
|
-
Metrics/BlockLength:
|
21
|
-
Enabled: false
|
22
|
-
Max: 61
|
18
|
+
Max: 24
|
23
19
|
|
24
20
|
# Offense count: 1
|
25
|
-
# Configuration parameters: CountComments.
|
21
|
+
# Configuration parameters: CountComments, CountAsOne.
|
26
22
|
Metrics/ClassLength:
|
27
|
-
|
28
|
-
Max: 106
|
23
|
+
Max: 108
|
29
24
|
|
30
|
-
# Offense count:
|
25
|
+
# Offense count: 5
|
26
|
+
# Configuration parameters: AllowedMethods, AllowedPatterns.
|
31
27
|
Metrics/CyclomaticComplexity:
|
32
28
|
Max: 8
|
33
29
|
|
34
30
|
# Offense count: 7
|
35
|
-
# Configuration parameters: CountComments.
|
31
|
+
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
|
36
32
|
Metrics/MethodLength:
|
37
33
|
Max: 25
|
38
34
|
|
35
|
+
# Offense count: 1
|
36
|
+
# Configuration parameters: ExpectMatchingDefinition, CheckDefinitionPathHierarchy, CheckDefinitionPathHierarchyRoots, Regex, IgnoreExecutableScripts, AllowedAcronyms.
|
37
|
+
# CheckDefinitionPathHierarchyRoots: lib, spec, test, src
|
38
|
+
# AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS
|
39
|
+
Naming/FileName:
|
40
|
+
Exclude:
|
41
|
+
- 'Rakefile.rb'
|
42
|
+
- 'lib/rubocop-i18n.rb'
|
43
|
+
|
44
|
+
# Offense count: 47
|
45
|
+
# Configuration parameters: Prefixes, AllowedPatterns.
|
46
|
+
# Prefixes: when, with, without
|
47
|
+
RSpec/ContextWording:
|
48
|
+
Exclude:
|
49
|
+
- 'spec/rubocop/cop/i18n/get_text/decorate_function_message_spec.rb'
|
50
|
+
- 'spec/rubocop/cop/i18n/get_text/decorate_string_formatting_using_interpolation_spec.rb'
|
51
|
+
- 'spec/rubocop/cop/i18n/get_text/decorate_string_formatting_using_percent_spec.rb'
|
52
|
+
- 'spec/rubocop/cop/i18n/get_text/decorate_string_spec.rb'
|
53
|
+
- 'spec/rubocop/cop/i18n/rails_i18n/decorate_string_formatting_using_interpolation_spec.rb'
|
54
|
+
- 'spec/rubocop/cop/i18n/rails_i18n/decorate_string_spec.rb'
|
55
|
+
|
56
|
+
# Offense count: 7
|
57
|
+
# Configuration parameters: AssignmentOnly.
|
58
|
+
RSpec/InstanceVariable:
|
59
|
+
Exclude:
|
60
|
+
- 'spec/rubocop/cop/i18n/get_text/decorate_function_message_spec.rb'
|
61
|
+
- 'spec/shared_examples.rb'
|
62
|
+
|
39
63
|
# Offense count: 2
|
40
|
-
|
41
|
-
Max:
|
64
|
+
RSpec/MultipleExpectations:
|
65
|
+
Max: 3
|
42
66
|
|
43
67
|
# Offense count: 2
|
68
|
+
# Configuration parameters: AllowedConstants.
|
44
69
|
Style/Documentation:
|
45
70
|
Exclude:
|
46
71
|
- 'spec/**/*'
|
@@ -49,37 +74,40 @@ Style/Documentation:
|
|
49
74
|
- 'lib/rubocop/cop/i18n/gettext/decorate_function_message.rb'
|
50
75
|
|
51
76
|
# Offense count: 12
|
52
|
-
#
|
77
|
+
# This cop supports safe autocorrection (--autocorrect).
|
78
|
+
# Configuration parameters: MaxUnannotatedPlaceholdersAllowed, AllowedMethods, AllowedPatterns.
|
53
79
|
# SupportedStyles: annotated, template, unannotated
|
54
80
|
Style/FormatStringToken:
|
55
|
-
|
56
|
-
- 'spec/rubocop/cop/i18n/gettext/decorate_function_message_spec.rb'
|
57
|
-
- 'spec/rubocop/cop/i18n/gettext/decorate_string_formatting_using_interpolation_spec.rb'
|
58
|
-
- 'spec/rubocop/cop/i18n/rails_i18n/decorate_string_formatting_using_interpolation_spec.rb'
|
59
|
-
- 'spec/rubocop/cop/i18n/gettext/decorate_string_formatting_using_percent_spec.rb'
|
60
|
-
- 'spec/rubocop/cop/i18n/gettext/decorate_string_spec.rb'
|
81
|
+
EnforcedStyle: template
|
61
82
|
|
62
|
-
# Offense count:
|
63
|
-
#
|
83
|
+
# Offense count: 2
|
84
|
+
# This cop supports safe autocorrection (--autocorrect).
|
85
|
+
# Configuration parameters: MinBodyLength, AllowConsecutiveConditionals.
|
64
86
|
Style/GuardClause:
|
65
87
|
Exclude:
|
66
88
|
- 'lib/rubocop/cop/i18n/gettext/decorate_function_message.rb'
|
67
89
|
- 'lib/rubocop/cop/i18n/gettext/decorate_string_formatting_using_percent.rb'
|
68
90
|
|
69
|
-
# Offense count:
|
70
|
-
#
|
91
|
+
# Offense count: 6
|
92
|
+
# This cop supports safe autocorrection (--autocorrect).
|
71
93
|
Style/IfUnlessModifier:
|
72
94
|
Exclude:
|
73
95
|
- 'lib/rubocop/cop/i18n/gettext/decorate_function_message.rb'
|
74
96
|
- 'lib/rubocop/cop/i18n/gettext/decorate_string_formatting_using_percent.rb'
|
75
|
-
- 'lib/rubocop/rspec/cop_helper.rb'
|
76
97
|
|
77
|
-
# Offense count:
|
78
|
-
#
|
98
|
+
# Offense count: 5
|
99
|
+
# This cop supports safe autocorrection (--autocorrect).
|
100
|
+
# Configuration parameters: AllowModifier.
|
101
|
+
Style/SoleNestedConditional:
|
102
|
+
Exclude:
|
103
|
+
- 'lib/rubocop/cop/i18n/gettext/decorate_function_message.rb'
|
104
|
+
- 'lib/rubocop/cop/i18n/gettext/decorate_string.rb'
|
105
|
+
- 'lib/rubocop/cop/i18n/gettext/decorate_string_formatting_using_percent.rb'
|
106
|
+
- 'lib/rubocop/cop/i18n/rails_i18n/decorate_string.rb'
|
107
|
+
|
108
|
+
# Offense count: 47
|
109
|
+
# This cop supports safe autocorrection (--autocorrect).
|
110
|
+
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns, SplitStrings.
|
79
111
|
# URISchemes: http, https
|
80
|
-
|
112
|
+
Layout/LineLength:
|
81
113
|
Max: 174
|
82
|
-
|
83
|
-
Naming/FileName:
|
84
|
-
Exclude:
|
85
|
-
- 'lib/rubocop-i18n.rb'
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
3.4.1
|
data/CHANGELOG.md
CHANGED
@@ -1,8 +1,20 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
-
### [master (Unreleased)](https://github.com/
|
3
|
+
### [master (Unreleased)](https://github.com/rubocop/rubocop-i18n/compare/v3.1.0...master)
|
4
4
|
|
5
|
-
### [
|
5
|
+
### [3.1.0](https://github.com/rubocop/rubocop-i18n/compare/v3.0.0...v3.1.0)
|
6
|
+
|
7
|
+
* Transfer ownership of rubocop-i18n from puppetlabs org to rubocop org (#62)
|
8
|
+
* Suppress RuboCop warnings (#59)
|
9
|
+
|
10
|
+
### [3.0.0](https://github.com/rubocop/rubocop-i18n/compare/v2.0.2...v3.0.0)
|
11
|
+
|
12
|
+
* Update Rubocop version to 1.0! Thank you @mvz!
|
13
|
+
* Cop namespace fixes, documentation updates, loading issues. Thank you again @mvz !
|
14
|
+
* Gem maintainership has been passed to @highb. Thank you @binford2k and @lucywyman!
|
15
|
+
* Update Ruby versions in gemspec, Travis, .ruby-version. Thank you @sfeuga!
|
16
|
+
|
17
|
+
### [2.0.2](https://github.com/rubocop/rubocop-i18n/compare/v2.0.1...v2.0.2)
|
6
18
|
|
7
19
|
* Add auto-correct for `DecorateString` (#40) Thanks @mvz!
|
8
20
|
* Update rake and bundler requirements to be more permissive of newer versions (#43)
|
data/CODE_OF_CONDUCT.md
CHANGED
@@ -1,74 +1,14 @@
|
|
1
|
-
#
|
1
|
+
# The RuboCop Community Code of Conduct
|
2
2
|
|
3
|
-
|
3
|
+
**Note:** We have picked the following code of conduct based on [Ruby's own code of conduct](https://www.ruby-lang.org/en/conduct/).
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
orientation.
|
5
|
+
This document provides a few simple community guidelines for a safe, respectful,
|
6
|
+
productive, and collaborative place for any person who is willing to contribute
|
7
|
+
to the RuboCop community. It applies to all "collaborative spaces", which are
|
8
|
+
defined as community communications channels (such as mailing lists, submitted
|
9
|
+
patches, commit comments, etc.).
|
11
10
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
* Using welcoming and inclusive language
|
18
|
-
* Being respectful of differing viewpoints and experiences
|
19
|
-
* Gracefully accepting constructive criticism
|
20
|
-
* Focusing on what is best for the community
|
21
|
-
* Showing empathy towards other community members
|
22
|
-
|
23
|
-
Examples of unacceptable behavior by participants include:
|
24
|
-
|
25
|
-
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
-
advances
|
27
|
-
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
-
* Public or private harassment
|
29
|
-
* Publishing others' private information, such as a physical or electronic
|
30
|
-
address, without explicit permission
|
31
|
-
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
-
professional setting
|
33
|
-
|
34
|
-
## Our Responsibilities
|
35
|
-
|
36
|
-
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
-
behavior and are expected to take appropriate and fair corrective action in
|
38
|
-
response to any instances of unacceptable behavior.
|
39
|
-
|
40
|
-
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
-
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
-
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
-
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
-
threatening, offensive, or harmful.
|
45
|
-
|
46
|
-
## Scope
|
47
|
-
|
48
|
-
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
-
when an individual is representing the project or its community. Examples of
|
50
|
-
representing a project or community include using an official project e-mail
|
51
|
-
address, posting via an official social media account, or acting as an appointed
|
52
|
-
representative at an online or offline event. Representation of a project may be
|
53
|
-
further defined and clarified by project maintainers.
|
54
|
-
|
55
|
-
## Enforcement
|
56
|
-
|
57
|
-
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
-
reported by contacting the project team at brandon.high@puppet.com. All
|
59
|
-
complaints will be reviewed and investigated and will result in a response that
|
60
|
-
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
-
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
-
Further details of specific enforcement policies may be posted separately.
|
63
|
-
|
64
|
-
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
-
faith may face temporary or permanent repercussions as determined by other
|
66
|
-
members of the project's leadership.
|
67
|
-
|
68
|
-
## Attribution
|
69
|
-
|
70
|
-
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
-
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
-
|
73
|
-
[homepage]: http://contributor-covenant.org
|
74
|
-
[version]: http://contributor-covenant.org/version/1/4/
|
11
|
+
* Participants will be tolerant of opposing views.
|
12
|
+
* Participants must ensure that their language and actions are free of personal attacks and disparaging personal remarks.
|
13
|
+
* When interpreting the words and actions of others, participants should always assume good intentions.
|
14
|
+
* Behavior which can be reasonably considered harassment will not be tolerated.
|
data/Gemfile
CHANGED
@@ -4,3 +4,12 @@ source 'https://rubygems.org'
|
|
4
4
|
|
5
5
|
# Specify your gem's dependencies in rubocop-i18n.gemspec
|
6
6
|
gemspec
|
7
|
+
|
8
|
+
gem 'bundler', '>= 1.17.3'
|
9
|
+
gem 'pry', '~> 0.13.1'
|
10
|
+
gem 'rake', '>= 12.3.3'
|
11
|
+
gem 'rb-readline', '~> 0.5.5'
|
12
|
+
gem 'rspec', '~> 3.0'
|
13
|
+
gem 'rubocop-performance'
|
14
|
+
gem 'rubocop-rake'
|
15
|
+
gem 'rubocop-rspec'
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Rubocop::I18n
|
2
2
|
|
3
|
-
[![Build Status](https://travis-ci.
|
3
|
+
[![Build Status](https://travis-ci.com/puppetlabs/rubocop-i18n.svg?branch=master)](https://travis-ci.com/puppetlabs/rubocop-i18n)
|
4
4
|
|
5
5
|
A set of cops for detecting strings that need i18n decoration in your project.
|
6
6
|
|
@@ -34,35 +34,35 @@ require:
|
|
34
34
|
...
|
35
35
|
# You *must* choose GetText or Rails-i18n style checking
|
36
36
|
# If you want GetText-style checking
|
37
|
-
GetText:
|
37
|
+
I18n/GetText:
|
38
38
|
Enabled: true
|
39
|
-
RailsI18n:
|
39
|
+
I18n/RailsI18n:
|
40
40
|
Enabled: false
|
41
41
|
# If you want rails-i18n-style checking
|
42
|
-
RailsI18n:
|
42
|
+
I18n/RailsI18n:
|
43
43
|
Enabled: true
|
44
|
-
GetText:
|
44
|
+
I18n/GetText:
|
45
45
|
Enabled: false
|
46
46
|
# If you want custom control of all the cops
|
47
|
-
GetText/DecorateString:
|
47
|
+
I18n/GetText/DecorateString:
|
48
48
|
Enabled: false
|
49
49
|
# Disable the autocorrect
|
50
50
|
AutoCorrect: false
|
51
|
-
GetText/DecorateFunctionMessage:
|
51
|
+
I18n/GetText/DecorateFunctionMessage:
|
52
52
|
Enabled: false
|
53
|
-
GetText/DecorateStringFormattingUsingInterpolation:
|
53
|
+
I18n/GetText/DecorateStringFormattingUsingInterpolation:
|
54
54
|
Enabled: false
|
55
|
-
GetText/DecorateStringFormattingUsingPercent:
|
55
|
+
I18n/GetText/DecorateStringFormattingUsingPercent:
|
56
56
|
Enabled: false
|
57
|
-
RailsI18n/DecorateString:
|
57
|
+
I18n/RailsI18n/DecorateString:
|
58
58
|
Enabled: false
|
59
59
|
```
|
60
60
|
|
61
61
|
## Cops
|
62
62
|
|
63
|
-
### GetText/DecorateString
|
63
|
+
### I18n/GetText/DecorateString
|
64
64
|
|
65
|
-
This cop is looks for strings that appear to be sentences but are not decorated.
|
65
|
+
This cop is looks for strings that appear to be sentences but are not decorated.
|
66
66
|
Sentences are determined by the STRING_REGEXP.
|
67
67
|
|
68
68
|
##### Error message thrown
|
@@ -90,7 +90,7 @@ _("Result is good.")
|
|
90
90
|
"a string that doesn't start with a capital letter."
|
91
91
|
```
|
92
92
|
|
93
|
-
### GetText/DecorateFunctionMessage
|
93
|
+
### I18n/GetText/DecorateFunctionMessage
|
94
94
|
|
95
95
|
This cop looks for any raise or fail functions and checks that the user visible message is using gettext decoration with the _() function.
|
96
96
|
This cop makes sure the message is decorated, as well as checking that the formatting of the message is compliant according to the follow rules.
|
@@ -203,10 +203,10 @@ raise(someOtherFuntioncall(foo, "bar"))
|
|
203
203
|
|
204
204
|
##### Good
|
205
205
|
|
206
|
-
In this raise or fail function, the message does not contain any decoration at all and the message is not a simple string. It may make sense to convert the message to a simple string. eg [Simple decoration of a message](#Simple-decoration-of-a-message).
|
206
|
+
In this raise or fail function, the message does not contain any decoration at all and the message is not a simple string. It may make sense to convert the message to a simple string. eg [Simple decoration of a message](#Simple-decoration-of-a-message).
|
207
207
|
Or ignore this raise or fail function following this [How to ignore rules in code](#How-to-ignore-rules-in-code) section.
|
208
208
|
|
209
|
-
### GetText/DecorateStringFormattingUsingInterpolation
|
209
|
+
### I18n/GetText/DecorateStringFormattingUsingInterpolation
|
210
210
|
|
211
211
|
This cop looks for decorated gettext methods _() and checks that all strings contained
|
212
212
|
within do not use string interpolation '#{}'
|
@@ -233,7 +233,7 @@ puts _("a message with a #{'interpolation'}")
|
|
233
233
|
puts _("a message that is %{type}") % { type: 'translatable' }
|
234
234
|
```
|
235
235
|
|
236
|
-
### GetText/DecorateStringFormattingUsingPercent
|
236
|
+
### I18n/GetText/DecorateStringFormattingUsingPercent
|
237
237
|
|
238
238
|
This cop looks for decorated gettext methods _() and checks that all strings contained
|
239
239
|
within do not use sprintf formatting '%s' etc
|
@@ -256,7 +256,7 @@ raise(_("Warning is %s") % ['bad'])
|
|
256
256
|
raise(_("Warning is %{value}") % { value: 'bad' })
|
257
257
|
```
|
258
258
|
|
259
|
-
### RailsI18n/DecorateString
|
259
|
+
### I18n/RailsI18n/DecorateString
|
260
260
|
|
261
261
|
This cop looks for decorated rails-i18n methods.
|
262
262
|
|
@@ -280,7 +280,7 @@ raise(translate("Warning is %{value}") % { value: 'good' })
|
|
280
280
|
raise(I18n.t("Warning is %{value}") % { value: 'good' })
|
281
281
|
```
|
282
282
|
|
283
|
-
### RailsI18n/DecorateStringFormattingUsingInterpolation
|
283
|
+
### I18n/RailsI18n/DecorateStringFormattingUsingInterpolation
|
284
284
|
|
285
285
|
This cop looks for decorated rails-i18n methods like `t()` and `translate()` and checks that all strings contained
|
286
286
|
within do not use string interpolation '#{}'
|
@@ -311,11 +311,11 @@ puts t("path.to.key.with.interpolation")
|
|
311
311
|
|
312
312
|
It may be necessary to ignore a cop for a particular piece of code. We follow standard rubocop idioms.
|
313
313
|
``` ruby
|
314
|
-
raise("We don't want this translated.") # rubocop:disable GetText/DecorateString
|
315
|
-
raise("We don't want this translated.") # rubocop:disable RailsI18n/DecorateString
|
316
|
-
raise("We don't want this translated") # rubocop:disable GetText/DecorateFunctionMessage
|
317
|
-
raise(_("We don't want this translated #{crazy}") # rubocop:disable GetText/DecorateStringFormattingUsingInterpolation)
|
318
|
-
raise(_("We don't want this translated %s") % ['crazy'] # rubocop:disable GetText/DecorateStringFormattingUsingPercent)
|
314
|
+
raise("We don't want this translated.") # rubocop:disable I18n/GetText/DecorateString
|
315
|
+
raise("We don't want this translated.") # rubocop:disable I18n/RailsI18n/DecorateString
|
316
|
+
raise("We don't want this translated") # rubocop:disable I18n/GetText/DecorateFunctionMessage
|
317
|
+
raise(_("We don't want this translated #{crazy}") # rubocop:disable I18n/GetText/DecorateStringFormattingUsingInterpolation)
|
318
|
+
raise(_("We don't want this translated %s") % ['crazy'] # rubocop:disable I18n/GetText/DecorateStringFormattingUsingPercent)
|
319
319
|
```
|
320
320
|
|
321
321
|
## Known Issues
|
@@ -331,5 +331,4 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
331
331
|
|
332
332
|
## Contributing
|
333
333
|
|
334
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
335
|
-
|
334
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/rubocop/rubocop-i18n. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [The RuboCop Community Code of Conduct](CODE_OF_CONDUCT.md).
|
data/Rakefile
CHANGED
data/config/default.yml
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
---
|
2
|
+
I18n:
|
3
|
+
Enabled: true
|
4
|
+
|
5
|
+
I18n/GetText:
|
6
|
+
Enabled: false
|
7
|
+
|
8
|
+
I18n/GetText/DecorateString:
|
9
|
+
Enabled: true
|
10
|
+
AutoCorrect: false
|
11
|
+
|
12
|
+
I18n/GetText/DecorateFunctionMessage:
|
13
|
+
Enabled: true
|
14
|
+
|
15
|
+
I18n/GetText/DecorateStringFormattingUsingInterpolation:
|
16
|
+
Enabled: true
|
17
|
+
|
18
|
+
I18n/GetText/DecorateStringFormattingUsingPercent:
|
19
|
+
Enabled: true
|
20
|
+
|
21
|
+
I18n/RailsI18n:
|
22
|
+
Enabled: false
|
23
|
+
|
24
|
+
I18n/RailsI18n/DecorateString:
|
25
|
+
Enabled: true
|
@@ -4,7 +4,9 @@ module RuboCop
|
|
4
4
|
module Cop
|
5
5
|
module I18n
|
6
6
|
module GetText
|
7
|
-
class DecorateFunctionMessage <
|
7
|
+
class DecorateFunctionMessage < Base
|
8
|
+
extend AutoCorrector
|
9
|
+
|
8
10
|
def on_send(node)
|
9
11
|
method_name = node.loc.selector.source
|
10
12
|
return unless GetText.supported_method?(method_name)
|
@@ -22,14 +24,6 @@ module RuboCop
|
|
22
24
|
end
|
23
25
|
end
|
24
26
|
|
25
|
-
def autocorrect(node)
|
26
|
-
if node.str_type?
|
27
|
-
single_string_correct(node)
|
28
|
-
elsif interpolation_offense?(node)
|
29
|
-
# interpolation_correct(node)
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
27
|
private
|
34
28
|
|
35
29
|
def already_decorated?(node, parent = nil)
|
@@ -65,7 +59,17 @@ module RuboCop
|
|
65
59
|
error_message << 'message should be decorated. ' if error == :no_decoration
|
66
60
|
end
|
67
61
|
error_message = error_message.join('\n')
|
68
|
-
add_offense(message_section, message: error_message)
|
62
|
+
add_offense(message_section, message: error_message) do |corrector|
|
63
|
+
autocorrect(corrector, message_section)
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
def autocorrect(corrector, node)
|
68
|
+
if node.str_type?
|
69
|
+
single_string_correct(corrector, node)
|
70
|
+
elsif interpolation_offense?(node)
|
71
|
+
# interpolation_correct(node)
|
72
|
+
end
|
69
73
|
end
|
70
74
|
|
71
75
|
def how_bad_is_it(message_section)
|
@@ -106,11 +110,8 @@ module RuboCop
|
|
106
110
|
node.children.any? { |child| interpolation_offense?(child, parent) }
|
107
111
|
end
|
108
112
|
|
109
|
-
def single_string_correct(node)
|
110
|
-
|
111
|
-
corrector.insert_before(node.source_range, '_(')
|
112
|
-
corrector.insert_after(node.source_range, ')')
|
113
|
-
}
|
113
|
+
def single_string_correct(corrector, node)
|
114
|
+
corrector.wrap(node.source_range, '_(', ')')
|
114
115
|
end
|
115
116
|
|
116
117
|
def interpolation_correct(node)
|
@@ -136,16 +137,16 @@ module RuboCop
|
|
136
137
|
if interpolated_values_string.empty?
|
137
138
|
interpolated_values_string << '{ '
|
138
139
|
end
|
139
|
-
interpolated_values_string << "#{hash_key}: #{value.
|
140
|
+
interpolated_values_string << "#{hash_key}: #{value.source}, "
|
140
141
|
|
141
142
|
# Replace interpolation with format string
|
142
|
-
corrector.replace(child
|
143
|
+
corrector.replace(child, "%{#{hash_key}}")
|
143
144
|
end
|
144
145
|
unless interpolated_values_string.empty?
|
145
146
|
interpolated_values_string << '}'
|
146
147
|
end
|
147
|
-
corrector.insert_before(node
|
148
|
-
corrector.insert_after(node
|
148
|
+
corrector.insert_before(node, '_(')
|
149
|
+
corrector.insert_after(node, ") % #{interpolated_values_string}")
|
149
150
|
}
|
150
151
|
end
|
151
152
|
end
|
@@ -4,7 +4,7 @@ module RuboCop
|
|
4
4
|
module Cop
|
5
5
|
module I18n
|
6
6
|
module GetText
|
7
|
-
#
|
7
|
+
# Looks for strings that appear to be sentences but are not decorated.
|
8
8
|
# Sentences are determined by the STRING_REGEXP. (Upper case character, at least one space,
|
9
9
|
# and sentence punctuation at the end)
|
10
10
|
#
|
@@ -19,7 +19,9 @@ module RuboCop
|
|
19
19
|
# # good
|
20
20
|
#
|
21
21
|
# _("Result is good.")
|
22
|
-
class DecorateString <
|
22
|
+
class DecorateString < Base
|
23
|
+
extend AutoCorrector
|
24
|
+
|
23
25
|
STRING_REGEXP = /^\s*[[:upper:]][[:alpha:]]*[[:blank:]]+.*[.!?]$/.freeze
|
24
26
|
|
25
27
|
def on_dstr(node)
|
@@ -37,10 +39,6 @@ module RuboCop
|
|
37
39
|
check_for_parent_decorator(node)
|
38
40
|
end
|
39
41
|
|
40
|
-
def autocorrect(node)
|
41
|
-
single_string_correct(node) if node.str_type?
|
42
|
-
end
|
43
|
-
|
44
42
|
private
|
45
43
|
|
46
44
|
def sentence?(node)
|
@@ -70,14 +68,13 @@ module RuboCop
|
|
70
68
|
elsif parent.respond_to?(:method_name) && parent.method?(:[])
|
71
69
|
return
|
72
70
|
end
|
73
|
-
add_offense(node, message: 'decorator is missing around sentence')
|
71
|
+
add_offense(node, message: 'decorator is missing around sentence') do |corrector|
|
72
|
+
single_string_correct(corrector, node) if node.str_type?
|
73
|
+
end
|
74
74
|
end
|
75
75
|
|
76
|
-
def single_string_correct(node)
|
77
|
-
|
78
|
-
corrector.insert_before(node.source_range, '_(')
|
79
|
-
corrector.insert_after(node.source_range, ')')
|
80
|
-
}
|
76
|
+
def single_string_correct(corrector, node)
|
77
|
+
corrector.wrap(node.source_range, '_(', ')')
|
81
78
|
end
|
82
79
|
end
|
83
80
|
end
|
@@ -22,7 +22,7 @@ module RuboCop
|
|
22
22
|
#
|
23
23
|
# _("result is %{detail}" % {detail: message})
|
24
24
|
#
|
25
|
-
class DecorateStringFormattingUsingInterpolation <
|
25
|
+
class DecorateStringFormattingUsingInterpolation < Base
|
26
26
|
def on_send(node)
|
27
27
|
decorator_name = node.loc.selector.source
|
28
28
|
return unless GetText.supported_decorator?(decorator_name)
|
@@ -23,7 +23,7 @@ module RuboCop
|
|
23
23
|
#
|
24
24
|
# _("result is %{detail}" % {detail: message})
|
25
25
|
#
|
26
|
-
class DecorateStringFormattingUsingPercent <
|
26
|
+
class DecorateStringFormattingUsingPercent < Base
|
27
27
|
SUPPORTED_FORMATS = %w[b B d i o u x X e E f g G a A c p s].freeze
|
28
28
|
|
29
29
|
def on_send(node)
|
@@ -4,7 +4,7 @@ module RuboCop
|
|
4
4
|
module Cop
|
5
5
|
module I18n
|
6
6
|
module RailsI18n
|
7
|
-
#
|
7
|
+
# Looks for strings that appear to be sentences but are not decorated.
|
8
8
|
# Sentences are determined by the SENTENCE_REGEXP. (Upper case character, at least one space,
|
9
9
|
# and sentence punctuation at the end)
|
10
10
|
#
|
@@ -70,7 +70,7 @@ module RuboCop
|
|
70
70
|
# "Any other string is fine now"
|
71
71
|
# t("only_this_text")
|
72
72
|
#
|
73
|
-
class DecorateString <
|
73
|
+
class DecorateString < Base
|
74
74
|
SENTENCE_REGEXP = /^\s*[[:upper:]][[:alpha:]]*[[:blank:]]+.*[.!?]$/.freeze
|
75
75
|
FRAGMENTED_SENTENCE_REGEXP = /^\s*([[:upper:]][[:alpha:]]*[[:blank:]]+.*)|([[:alpha:]]*[[:blank:]]+.*[.!?])$/.freeze
|
76
76
|
FRAGMENT_REGEXP = /^\s*[[:alpha:]]*[[:blank:]]+.*$/.freeze
|
@@ -122,7 +122,7 @@ module RuboCop
|
|
122
122
|
when 'sentence' then SENTENCE_REGEXP
|
123
123
|
when 'fragmented_sentence' then FRAGMENTED_SENTENCE_REGEXP
|
124
124
|
when 'fragment' then FRAGMENT_REGEXP
|
125
|
-
else
|
125
|
+
else # rubocop:disable Lint/DuplicateBranch
|
126
126
|
SENTENCE_REGEXP
|
127
127
|
end
|
128
128
|
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'i18n/gettext'
|
4
|
+
require_relative 'i18n/gettext/decorate_string'
|
5
|
+
require_relative 'i18n/gettext/decorate_function_message'
|
6
|
+
require_relative 'i18n/gettext/decorate_string_formatting_using_interpolation'
|
7
|
+
require_relative 'i18n/gettext/decorate_string_formatting_using_percent'
|
8
|
+
|
9
|
+
require_relative 'i18n/rails_i18n'
|
10
|
+
require_relative 'i18n/rails_i18n/decorate_string'
|
11
|
+
require_relative 'i18n/rails_i18n/decorate_string_formatting_using_interpolation'
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module RuboCop
|
4
|
+
module I18n
|
5
|
+
# Because RuboCop doesn't yet support plugins, we have to monkey patch in a
|
6
|
+
# bit of our configuration.
|
7
|
+
module Inject
|
8
|
+
def self.defaults!
|
9
|
+
path = CONFIG_DEFAULT.to_s
|
10
|
+
hash = ConfigLoader.send(:load_yaml_configuration, path)
|
11
|
+
config = RuboCop::Config.new(hash, path)
|
12
|
+
puts "configuration from #{path}" if ConfigLoader.debug?
|
13
|
+
config = ConfigLoader.merge_with_default(config, path)
|
14
|
+
ConfigLoader.instance_variable_set(:@default_configuration, config)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
data/lib/rubocop/i18n.rb
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module RuboCop
|
4
|
+
# RuboCop I18n project namespace
|
5
|
+
module I18n
|
6
|
+
PROJECT_ROOT = Pathname.new(__dir__).parent.parent.expand_path.freeze
|
7
|
+
CONFIG_DEFAULT = PROJECT_ROOT.join('config', 'default.yml').freeze
|
8
|
+
|
9
|
+
private_constant(:CONFIG_DEFAULT, :PROJECT_ROOT)
|
10
|
+
end
|
11
|
+
end
|
data/lib/rubocop-i18n.rb
CHANGED
data/rubocop-i18n.gemspec
CHANGED
@@ -2,17 +2,15 @@
|
|
2
2
|
|
3
3
|
lib = File.expand_path('lib', __dir__)
|
4
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
-
rubocop_version = '~> 0.51'
|
6
5
|
|
7
6
|
Gem::Specification.new do |spec|
|
8
7
|
spec.name = 'rubocop-i18n'
|
9
|
-
spec.version = '
|
8
|
+
spec.version = '3.1.0'
|
10
9
|
spec.authors = ['Puppet', 'Brandon High', 'TP Honey', 'Helen Campbell']
|
11
|
-
spec.email = ['team-modules@puppet.com', 'brandon.high@puppet.com', 'tp@puppet.com', 'helen@puppet.com']
|
12
10
|
|
13
11
|
spec.summary = 'RuboCop rules for i18n'
|
14
12
|
spec.description = 'RuboCop rules for detecting and autocorrecting undecorated strings for i18n (gettext and rails-i18n)'
|
15
|
-
spec.homepage = 'https://github.com/
|
13
|
+
spec.homepage = 'https://github.com/rubocop/rubocop-i18n'
|
16
14
|
spec.license = 'Apache-2.0'
|
17
15
|
|
18
16
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
@@ -22,11 +20,11 @@ Gem::Specification.new do |spec|
|
|
22
20
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
23
21
|
spec.require_paths = ['lib']
|
24
22
|
|
25
|
-
spec.
|
26
|
-
|
27
|
-
spec.
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
spec.
|
23
|
+
spec.required_ruby_version = '>= 2.5.8'
|
24
|
+
|
25
|
+
spec.metadata = {
|
26
|
+
'rubygems_mfa_required' => 'true'
|
27
|
+
}
|
28
|
+
|
29
|
+
spec.add_dependency 'rubocop', '~> 1.0'
|
32
30
|
end
|
metadata
CHANGED
@@ -1,134 +1,46 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubocop-i18n
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Puppet
|
8
8
|
- Brandon High
|
9
9
|
- TP Honey
|
10
10
|
- Helen Campbell
|
11
|
-
autorequire:
|
12
11
|
bindir: exe
|
13
12
|
cert_chain: []
|
14
|
-
date:
|
13
|
+
date: 2025-01-21 00:00:00.000000000 Z
|
15
14
|
dependencies:
|
16
|
-
- !ruby/object:Gem::Dependency
|
17
|
-
name: bundler
|
18
|
-
requirement: !ruby/object:Gem::Requirement
|
19
|
-
requirements:
|
20
|
-
- - ">="
|
21
|
-
- !ruby/object:Gem::Version
|
22
|
-
version: 1.17.3
|
23
|
-
type: :development
|
24
|
-
prerelease: false
|
25
|
-
version_requirements: !ruby/object:Gem::Requirement
|
26
|
-
requirements:
|
27
|
-
- - ">="
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: 1.17.3
|
30
|
-
- !ruby/object:Gem::Dependency
|
31
|
-
name: pry
|
32
|
-
requirement: !ruby/object:Gem::Requirement
|
33
|
-
requirements:
|
34
|
-
- - "~>"
|
35
|
-
- !ruby/object:Gem::Version
|
36
|
-
version: 0.13.1
|
37
|
-
type: :development
|
38
|
-
prerelease: false
|
39
|
-
version_requirements: !ruby/object:Gem::Requirement
|
40
|
-
requirements:
|
41
|
-
- - "~>"
|
42
|
-
- !ruby/object:Gem::Version
|
43
|
-
version: 0.13.1
|
44
|
-
- !ruby/object:Gem::Dependency
|
45
|
-
name: rake
|
46
|
-
requirement: !ruby/object:Gem::Requirement
|
47
|
-
requirements:
|
48
|
-
- - ">="
|
49
|
-
- !ruby/object:Gem::Version
|
50
|
-
version: 12.3.3
|
51
|
-
type: :development
|
52
|
-
prerelease: false
|
53
|
-
version_requirements: !ruby/object:Gem::Requirement
|
54
|
-
requirements:
|
55
|
-
- - ">="
|
56
|
-
- !ruby/object:Gem::Version
|
57
|
-
version: 12.3.3
|
58
|
-
- !ruby/object:Gem::Dependency
|
59
|
-
name: rb-readline
|
60
|
-
requirement: !ruby/object:Gem::Requirement
|
61
|
-
requirements:
|
62
|
-
- - "~>"
|
63
|
-
- !ruby/object:Gem::Version
|
64
|
-
version: 0.5.5
|
65
|
-
type: :development
|
66
|
-
prerelease: false
|
67
|
-
version_requirements: !ruby/object:Gem::Requirement
|
68
|
-
requirements:
|
69
|
-
- - "~>"
|
70
|
-
- !ruby/object:Gem::Version
|
71
|
-
version: 0.5.5
|
72
|
-
- !ruby/object:Gem::Dependency
|
73
|
-
name: rspec
|
74
|
-
requirement: !ruby/object:Gem::Requirement
|
75
|
-
requirements:
|
76
|
-
- - "~>"
|
77
|
-
- !ruby/object:Gem::Version
|
78
|
-
version: '3.0'
|
79
|
-
type: :development
|
80
|
-
prerelease: false
|
81
|
-
version_requirements: !ruby/object:Gem::Requirement
|
82
|
-
requirements:
|
83
|
-
- - "~>"
|
84
|
-
- !ruby/object:Gem::Version
|
85
|
-
version: '3.0'
|
86
|
-
- !ruby/object:Gem::Dependency
|
87
|
-
name: rubocop
|
88
|
-
requirement: !ruby/object:Gem::Requirement
|
89
|
-
requirements:
|
90
|
-
- - "~>"
|
91
|
-
- !ruby/object:Gem::Version
|
92
|
-
version: '0.51'
|
93
|
-
type: :development
|
94
|
-
prerelease: false
|
95
|
-
version_requirements: !ruby/object:Gem::Requirement
|
96
|
-
requirements:
|
97
|
-
- - "~>"
|
98
|
-
- !ruby/object:Gem::Version
|
99
|
-
version: '0.51'
|
100
15
|
- !ruby/object:Gem::Dependency
|
101
16
|
name: rubocop
|
102
17
|
requirement: !ruby/object:Gem::Requirement
|
103
18
|
requirements:
|
104
19
|
- - "~>"
|
105
20
|
- !ruby/object:Gem::Version
|
106
|
-
version: '0
|
21
|
+
version: '1.0'
|
107
22
|
type: :runtime
|
108
23
|
prerelease: false
|
109
24
|
version_requirements: !ruby/object:Gem::Requirement
|
110
25
|
requirements:
|
111
26
|
- - "~>"
|
112
27
|
- !ruby/object:Gem::Version
|
113
|
-
version: '0
|
28
|
+
version: '1.0'
|
114
29
|
description: RuboCop rules for detecting and autocorrecting undecorated strings for
|
115
30
|
i18n (gettext and rails-i18n)
|
116
|
-
email:
|
117
|
-
- team-modules@puppet.com
|
118
|
-
- brandon.high@puppet.com
|
119
|
-
- tp@puppet.com
|
120
|
-
- helen@puppet.com
|
121
31
|
executables: []
|
122
32
|
extensions: []
|
123
33
|
extra_rdoc_files: []
|
124
34
|
files:
|
35
|
+
- ".github/ISSUE_TEMPLATE/bug_report.md"
|
36
|
+
- ".github/ISSUE_TEMPLATE/feature_request.md"
|
37
|
+
- ".github/workflows/rubocop.yml"
|
125
38
|
- ".gitignore"
|
39
|
+
- ".rspec"
|
126
40
|
- ".rubocop.yml"
|
127
41
|
- ".rubocop_todo.yml"
|
128
42
|
- ".ruby-version"
|
129
|
-
- ".travis.yml"
|
130
43
|
- CHANGELOG.md
|
131
|
-
- CODEOWNERS
|
132
44
|
- CODE_OF_CONDUCT.md
|
133
45
|
- Gemfile
|
134
46
|
- LICENSE
|
@@ -136,8 +48,8 @@ files:
|
|
136
48
|
- Rakefile
|
137
49
|
- bin/console
|
138
50
|
- bin/setup
|
51
|
+
- config/default.yml
|
139
52
|
- lib/rubocop-i18n.rb
|
140
|
-
- lib/rubocop/cop/i18n.rb
|
141
53
|
- lib/rubocop/cop/i18n/gettext.rb
|
142
54
|
- lib/rubocop/cop/i18n/gettext/decorate_function_message.rb
|
143
55
|
- lib/rubocop/cop/i18n/gettext/decorate_string.rb
|
@@ -146,12 +58,15 @@ files:
|
|
146
58
|
- lib/rubocop/cop/i18n/rails_i18n.rb
|
147
59
|
- lib/rubocop/cop/i18n/rails_i18n/decorate_string.rb
|
148
60
|
- lib/rubocop/cop/i18n/rails_i18n/decorate_string_formatting_using_interpolation.rb
|
61
|
+
- lib/rubocop/cop/i18n_cops.rb
|
62
|
+
- lib/rubocop/i18n.rb
|
63
|
+
- lib/rubocop/i18n/inject.rb
|
149
64
|
- rubocop-i18n.gemspec
|
150
|
-
homepage: https://github.com/
|
65
|
+
homepage: https://github.com/rubocop/rubocop-i18n
|
151
66
|
licenses:
|
152
67
|
- Apache-2.0
|
153
|
-
metadata:
|
154
|
-
|
68
|
+
metadata:
|
69
|
+
rubygems_mfa_required: 'true'
|
155
70
|
rdoc_options: []
|
156
71
|
require_paths:
|
157
72
|
- lib
|
@@ -159,16 +74,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
159
74
|
requirements:
|
160
75
|
- - ">="
|
161
76
|
- !ruby/object:Gem::Version
|
162
|
-
version:
|
77
|
+
version: 2.5.8
|
163
78
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
164
79
|
requirements:
|
165
80
|
- - ">="
|
166
81
|
- !ruby/object:Gem::Version
|
167
82
|
version: '0'
|
168
83
|
requirements: []
|
169
|
-
|
170
|
-
rubygems_version: 2.7.6.2
|
171
|
-
signing_key:
|
84
|
+
rubygems_version: 3.6.2
|
172
85
|
specification_version: 4
|
173
86
|
summary: RuboCop rules for i18n
|
174
87
|
test_files: []
|
data/.travis.yml
DELETED
data/CODEOWNERS
DELETED
data/lib/rubocop/cop/i18n.rb
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'rubocop'
|
4
|
-
require 'rubocop/cop/i18n/gettext'
|
5
|
-
require 'rubocop/cop/i18n/gettext/decorate_string'
|
6
|
-
require 'rubocop/cop/i18n/gettext/decorate_function_message'
|
7
|
-
require 'rubocop/cop/i18n/gettext/decorate_string_formatting_using_interpolation'
|
8
|
-
require 'rubocop/cop/i18n/gettext/decorate_string_formatting_using_percent'
|
9
|
-
|
10
|
-
require 'rubocop/cop/i18n/rails_i18n'
|
11
|
-
require 'rubocop/cop/i18n/rails_i18n/decorate_string'
|
12
|
-
require 'rubocop/cop/i18n/rails_i18n/decorate_string_formatting_using_interpolation'
|