danger-missed_localizable_strings 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +148 -0
- data/CHANGELOG.md +4 -0
- data/Gemfile +1 -1
- data/Gemfile.lock +42 -48
- data/Guardfile +2 -2
- data/Rakefile +10 -10
- data/danger-missed_localizable_strings.gemspec +21 -21
- data/lib/danger_missed_localizable_strings.rb +1 -1
- data/lib/danger_plugin.rb +1 -1
- data/lib/missed_localizable_strings/gem_version.rb +1 -1
- data/lib/missed_localizable_strings/plugin.rb +6 -6
- data/spec/missed_localizable_strings_spec.rb +32 -32
- data/spec/spec_helper.rb +16 -16
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a5f6c5cf75dd5328ffbd1511b2667e5a49dfa73f
|
4
|
+
data.tar.gz: f139fe8a364f355bc3b4fdbaf988ccef2b915a33
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 134fb85e3b527baf73a162d59601db87b3fefd794cf51dc8e14803e8fbaf2867796403e6ed55c2ca0e4e4208d6701f4886b24649c47e5cd91ae8d6d402c37c36
|
7
|
+
data.tar.gz: c2b955f4a9f814f8c7f63781cd1217d54d92e64abea5e98e41b4ac16be78e60d5ec8c6969d5b74d67d201f5ef93cbad5ca42b943f5764b5ecf2cae10f7ab59d2
|
data/.rubocop.yml
ADDED
@@ -0,0 +1,148 @@
|
|
1
|
+
# Defaults can be found here: https://github.com/bbatsov/rubocop/blob/master/config/default.yml
|
2
|
+
|
3
|
+
AllCops:
|
4
|
+
TargetRubyVersion: 2.0
|
5
|
+
Exclude:
|
6
|
+
- 'spec/fixtures/**/*'
|
7
|
+
- 'lib/danger/plugin_support/plugin_parser.rb'
|
8
|
+
|
9
|
+
Style/StringLiterals:
|
10
|
+
EnforcedStyle: double_quotes
|
11
|
+
Enabled: true
|
12
|
+
|
13
|
+
# kind_of? is a good way to check a type
|
14
|
+
Style/ClassCheck:
|
15
|
+
EnforcedStyle: kind_of?
|
16
|
+
|
17
|
+
# It's better to be more explicit about the type
|
18
|
+
Style/BracesAroundHashParameters:
|
19
|
+
Enabled: false
|
20
|
+
|
21
|
+
# specs sometimes have useless assignments, which is fine
|
22
|
+
Lint/UselessAssignment:
|
23
|
+
Exclude:
|
24
|
+
- '**/spec/**/*'
|
25
|
+
|
26
|
+
# We could potentially enable the 2 below:
|
27
|
+
Style/IndentHash:
|
28
|
+
Enabled: false
|
29
|
+
|
30
|
+
Style/AlignHash:
|
31
|
+
Enabled: false
|
32
|
+
|
33
|
+
# HoundCI doesn't like this rule
|
34
|
+
Style/DotPosition:
|
35
|
+
Enabled: false
|
36
|
+
|
37
|
+
# We allow !! as it's an easy way to convert ot boolean
|
38
|
+
Style/DoubleNegation:
|
39
|
+
Enabled: false
|
40
|
+
|
41
|
+
# Cop supports --auto-correct.
|
42
|
+
Lint/UnusedBlockArgument:
|
43
|
+
Enabled: false
|
44
|
+
|
45
|
+
# We want to allow class Fastlane::Class
|
46
|
+
Style/ClassAndModuleChildren:
|
47
|
+
Enabled: false
|
48
|
+
|
49
|
+
Metrics/AbcSize:
|
50
|
+
Max: 60
|
51
|
+
|
52
|
+
# The %w might be confusing for new users
|
53
|
+
Style/WordArray:
|
54
|
+
MinSize: 19
|
55
|
+
|
56
|
+
# raise and fail are both okay
|
57
|
+
Style/SignalException:
|
58
|
+
Enabled: false
|
59
|
+
|
60
|
+
# Better too much 'return' than one missing
|
61
|
+
Style/RedundantReturn:
|
62
|
+
Enabled: false
|
63
|
+
|
64
|
+
# Having if in the same line might not always be good
|
65
|
+
Style/IfUnlessModifier:
|
66
|
+
Enabled: false
|
67
|
+
|
68
|
+
# and and or is okay
|
69
|
+
Style/AndOr:
|
70
|
+
Enabled: false
|
71
|
+
|
72
|
+
# Configuration parameters: CountComments.
|
73
|
+
Metrics/ClassLength:
|
74
|
+
Max: 320
|
75
|
+
|
76
|
+
Metrics/CyclomaticComplexity:
|
77
|
+
Max: 17
|
78
|
+
|
79
|
+
# Configuration parameters: AllowURI, URISchemes.
|
80
|
+
Metrics/LineLength:
|
81
|
+
Max: 370
|
82
|
+
|
83
|
+
# Configuration parameters: CountKeywordArgs.
|
84
|
+
Metrics/ParameterLists:
|
85
|
+
Max: 10
|
86
|
+
|
87
|
+
Metrics/PerceivedComplexity:
|
88
|
+
Max: 18
|
89
|
+
|
90
|
+
# Sometimes it's easier to read without guards
|
91
|
+
Style/GuardClause:
|
92
|
+
Enabled: false
|
93
|
+
|
94
|
+
# something = if something_else
|
95
|
+
# that's confusing
|
96
|
+
Style/ConditionalAssignment:
|
97
|
+
Enabled: false
|
98
|
+
|
99
|
+
# Better to have too much self than missing a self
|
100
|
+
Style/RedundantSelf:
|
101
|
+
Enabled: false
|
102
|
+
|
103
|
+
Metrics/MethodLength:
|
104
|
+
Max: 60
|
105
|
+
|
106
|
+
# We're not there yet
|
107
|
+
Style/Documentation:
|
108
|
+
Enabled: false
|
109
|
+
|
110
|
+
# Adds complexity
|
111
|
+
Style/IfInsideElse:
|
112
|
+
Enabled: false
|
113
|
+
|
114
|
+
# danger specific
|
115
|
+
|
116
|
+
Style/BlockComments:
|
117
|
+
Enabled: false
|
118
|
+
|
119
|
+
Style/MultilineMethodCallIndentation:
|
120
|
+
EnforcedStyle: indented
|
121
|
+
|
122
|
+
# FIXME: 25
|
123
|
+
Metrics/BlockLength:
|
124
|
+
Max: 345
|
125
|
+
|
126
|
+
Style/MixinGrouping:
|
127
|
+
Enabled: false
|
128
|
+
|
129
|
+
Style/FileName:
|
130
|
+
Enabled: false
|
131
|
+
|
132
|
+
Style/IndentHeredoc:
|
133
|
+
Enabled: false
|
134
|
+
|
135
|
+
Style/SpecialGlobalVars:
|
136
|
+
Enabled: false
|
137
|
+
|
138
|
+
PercentLiteralDelimiters:
|
139
|
+
PreferredDelimiters:
|
140
|
+
"%": ()
|
141
|
+
"%i": ()
|
142
|
+
"%q": ()
|
143
|
+
"%Q": ()
|
144
|
+
"%r": "{}"
|
145
|
+
"%s": ()
|
146
|
+
"%w": ()
|
147
|
+
"%W": ()
|
148
|
+
"%x": ()
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,13 +1,14 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
danger-missed_localizable_strings (1.0.
|
4
|
+
danger-missed_localizable_strings (1.0.2)
|
5
5
|
danger-plugin-api (~> 1.0)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
addressable (2.
|
10
|
+
addressable (2.5.1)
|
11
|
+
public_suffix (~> 2.0, >= 2.0.2)
|
11
12
|
ast (2.3.0)
|
12
13
|
claide (1.0.1)
|
13
14
|
claide-plugins (0.9.2)
|
@@ -15,35 +16,31 @@ GEM
|
|
15
16
|
nap
|
16
17
|
open4 (~> 1.3)
|
17
18
|
coderay (1.1.1)
|
18
|
-
|
19
|
-
cork (0.
|
20
|
-
|
21
|
-
danger (
|
19
|
+
colored2 (3.1.2)
|
20
|
+
cork (0.3.0)
|
21
|
+
colored2 (~> 3.1)
|
22
|
+
danger (5.2.0)
|
22
23
|
claide (~> 1.0)
|
23
24
|
claide-plugins (>= 0.9.2)
|
24
|
-
|
25
|
+
colored2 (~> 3.1)
|
25
26
|
cork (~> 0.1)
|
26
27
|
faraday (~> 0.9)
|
27
28
|
faraday-http-cache (~> 1.0)
|
28
29
|
git (~> 1)
|
29
|
-
gitlab (~> 3.7.0)
|
30
30
|
kramdown (~> 1.5)
|
31
31
|
octokit (~> 4.2)
|
32
32
|
terminal-table (~> 1)
|
33
33
|
danger-plugin-api (1.0.0)
|
34
34
|
danger (> 2.0)
|
35
|
-
diff-lcs (1.
|
36
|
-
faraday (0.
|
35
|
+
diff-lcs (1.3)
|
36
|
+
faraday (0.12.1)
|
37
37
|
multipart-post (>= 1.2, < 3)
|
38
38
|
faraday-http-cache (1.3.1)
|
39
39
|
faraday (~> 0.8)
|
40
|
-
ffi (1.9.
|
40
|
+
ffi (1.9.18)
|
41
41
|
formatador (0.2.5)
|
42
42
|
git (1.3.0)
|
43
|
-
|
44
|
-
httparty (~> 0.13.0)
|
45
|
-
terminal-table
|
46
|
-
guard (2.14.0)
|
43
|
+
guard (2.14.1)
|
47
44
|
formatador (>= 0.2.4)
|
48
45
|
listen (>= 2.7, < 4.0)
|
49
46
|
lumberjack (~> 1.0)
|
@@ -57,68 +54,65 @@ GEM
|
|
57
54
|
guard (~> 2.1)
|
58
55
|
guard-compat (~> 1.1)
|
59
56
|
rspec (>= 2.99.0, < 4.0)
|
60
|
-
|
61
|
-
json (~> 1.8)
|
62
|
-
multi_xml (>= 0.5.2)
|
63
|
-
json (1.8.3)
|
64
|
-
kramdown (1.12.0)
|
57
|
+
kramdown (1.13.2)
|
65
58
|
listen (3.0.7)
|
66
59
|
rb-fsevent (>= 0.9.3)
|
67
60
|
rb-inotify (>= 0.9.7)
|
68
|
-
lumberjack (1.0.
|
61
|
+
lumberjack (1.0.11)
|
69
62
|
method_source (0.8.2)
|
70
|
-
multi_xml (0.5.5)
|
71
63
|
multipart-post (2.0.0)
|
72
64
|
nap (1.1.0)
|
73
65
|
nenv (0.3.0)
|
74
66
|
notiffany (0.1.1)
|
75
67
|
nenv (~> 0.1)
|
76
68
|
shellany (~> 0.0)
|
77
|
-
octokit (4.
|
78
|
-
sawyer (~> 0.
|
69
|
+
octokit (4.7.0)
|
70
|
+
sawyer (~> 0.8.0, >= 0.5.3)
|
79
71
|
open4 (1.3.4)
|
80
|
-
parser (2.
|
72
|
+
parser (2.4.0.0)
|
81
73
|
ast (~> 2.2)
|
82
74
|
powerpack (0.1.1)
|
83
75
|
pry (0.10.4)
|
84
76
|
coderay (~> 1.1.0)
|
85
77
|
method_source (~> 0.8.1)
|
86
78
|
slop (~> 3.4)
|
87
|
-
|
79
|
+
public_suffix (2.0.5)
|
80
|
+
rainbow (2.2.2)
|
81
|
+
rake
|
88
82
|
rake (10.5.0)
|
89
|
-
rb-fsevent (0.9.
|
90
|
-
rb-inotify (0.9.
|
83
|
+
rb-fsevent (0.9.8)
|
84
|
+
rb-inotify (0.9.8)
|
91
85
|
ffi (>= 0.5.0)
|
92
|
-
rspec (3.
|
93
|
-
rspec-core (~> 3.
|
94
|
-
rspec-expectations (~> 3.
|
95
|
-
rspec-mocks (~> 3.
|
96
|
-
rspec-core (3.
|
97
|
-
rspec-support (~> 3.
|
98
|
-
rspec-expectations (3.
|
86
|
+
rspec (3.6.0)
|
87
|
+
rspec-core (~> 3.6.0)
|
88
|
+
rspec-expectations (~> 3.6.0)
|
89
|
+
rspec-mocks (~> 3.6.0)
|
90
|
+
rspec-core (3.6.0)
|
91
|
+
rspec-support (~> 3.6.0)
|
92
|
+
rspec-expectations (3.6.0)
|
99
93
|
diff-lcs (>= 1.2.0, < 2.0)
|
100
|
-
rspec-support (~> 3.
|
101
|
-
rspec-mocks (3.
|
94
|
+
rspec-support (~> 3.6.0)
|
95
|
+
rspec-mocks (3.6.0)
|
102
96
|
diff-lcs (>= 1.2.0, < 2.0)
|
103
|
-
rspec-support (~> 3.
|
104
|
-
rspec-support (3.
|
105
|
-
rubocop (0.
|
106
|
-
parser (>= 2.3.
|
97
|
+
rspec-support (~> 3.6.0)
|
98
|
+
rspec-support (3.6.0)
|
99
|
+
rubocop (0.48.1)
|
100
|
+
parser (>= 2.3.3.1, < 3.0)
|
107
101
|
powerpack (~> 0.1)
|
108
102
|
rainbow (>= 1.99.1, < 3.0)
|
109
103
|
ruby-progressbar (~> 1.7)
|
110
104
|
unicode-display_width (~> 1.0, >= 1.0.1)
|
111
105
|
ruby-progressbar (1.8.1)
|
112
|
-
sawyer (0.
|
113
|
-
addressable (>= 2.3.5, < 2.
|
114
|
-
faraday (~> 0.8, < 0
|
106
|
+
sawyer (0.8.1)
|
107
|
+
addressable (>= 2.3.5, < 2.6)
|
108
|
+
faraday (~> 0.8, < 1.0)
|
115
109
|
shellany (0.0.1)
|
116
110
|
slop (3.6.0)
|
117
111
|
terminal-table (1.7.3)
|
118
112
|
unicode-display_width (~> 1.1.1)
|
119
|
-
thor (0.19.
|
120
|
-
unicode-display_width (1.1.
|
121
|
-
yard (0.9.
|
113
|
+
thor (0.19.4)
|
114
|
+
unicode-display_width (1.1.3)
|
115
|
+
yard (0.9.9)
|
122
116
|
|
123
117
|
PLATFORMS
|
124
118
|
ruby
|
@@ -136,4 +130,4 @@ DEPENDENCIES
|
|
136
130
|
yard (~> 0.8)
|
137
131
|
|
138
132
|
BUNDLED WITH
|
139
|
-
1.13.
|
133
|
+
1.13.7
|
data/Guardfile
CHANGED
data/Rakefile
CHANGED
@@ -1,23 +1,23 @@
|
|
1
|
-
require
|
2
|
-
require
|
3
|
-
require
|
1
|
+
require "bundler/gem_tasks"
|
2
|
+
require "rspec/core/rake_task"
|
3
|
+
require "rubocop/rake_task"
|
4
4
|
|
5
5
|
RSpec::Core::RakeTask.new(:specs)
|
6
6
|
|
7
7
|
task default: :specs
|
8
8
|
|
9
9
|
task :spec do
|
10
|
-
Rake::Task[
|
11
|
-
Rake::Task[
|
12
|
-
Rake::Task[
|
10
|
+
Rake::Task["specs"].invoke
|
11
|
+
Rake::Task["rubocop"].invoke
|
12
|
+
Rake::Task["spec_docs"].invoke
|
13
13
|
end
|
14
14
|
|
15
|
-
desc
|
15
|
+
desc "Run RuboCop on the lib/specs directory"
|
16
16
|
RuboCop::RakeTask.new(:rubocop) do |task|
|
17
|
-
task.patterns = [
|
17
|
+
task.patterns = ["lib/**/*.rb", "spec/**/*.rb"]
|
18
18
|
end
|
19
19
|
|
20
|
-
desc
|
20
|
+
desc "Ensure that the plugin passes `danger plugins lint`"
|
21
21
|
task :spec_docs do
|
22
|
-
sh
|
22
|
+
sh "bundle exec danger plugins lint"
|
23
23
|
end
|
@@ -1,43 +1,43 @@
|
|
1
1
|
# coding: utf-8
|
2
|
-
|
3
|
-
lib = File.expand_path(
|
2
|
+
|
3
|
+
lib = File.expand_path("../lib", __FILE__)
|
4
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
-
require
|
5
|
+
require "missed_localizable_strings/gem_version.rb"
|
6
6
|
|
7
7
|
Gem::Specification.new do |spec|
|
8
|
-
spec.name =
|
8
|
+
spec.name = "danger-missed_localizable_strings"
|
9
9
|
spec.version = MissedLocalizableStrings::VERSION
|
10
|
-
spec.authors = [
|
11
|
-
spec.email = [
|
12
|
-
spec.description =
|
13
|
-
spec.summary =
|
14
|
-
spec.homepage =
|
15
|
-
spec.license =
|
10
|
+
spec.authors = ["Anton Domashnev"]
|
11
|
+
spec.email = ["antondomashnev@gmail.com"]
|
12
|
+
spec.description = "A Danger plugin to check missing localizable strings."
|
13
|
+
spec.summary = "A Danger plugin to check missing localizable strings."
|
14
|
+
spec.homepage = "https://github.com/Antondomashnev/danger-missed_localizable_strings"
|
15
|
+
spec.license = "MIT"
|
16
16
|
|
17
17
|
spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
|
18
18
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
19
19
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
20
|
-
spec.require_paths = [
|
20
|
+
spec.require_paths = ["lib"]
|
21
21
|
|
22
|
-
spec.add_runtime_dependency
|
22
|
+
spec.add_runtime_dependency "danger-plugin-api", "~> 1.0"
|
23
23
|
|
24
24
|
# General ruby development
|
25
|
-
spec.add_development_dependency
|
26
|
-
spec.add_development_dependency
|
25
|
+
spec.add_development_dependency "bundler", "~> 1.3"
|
26
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
27
27
|
|
28
28
|
# Testing support
|
29
|
-
spec.add_development_dependency
|
29
|
+
spec.add_development_dependency "rspec", "~> 3.4"
|
30
30
|
|
31
31
|
# Linting code and docs
|
32
|
-
spec.add_development_dependency
|
33
|
-
spec.add_development_dependency
|
32
|
+
spec.add_development_dependency "rubocop", "~> 0.41"
|
33
|
+
spec.add_development_dependency "yard", "~> 0.8"
|
34
34
|
|
35
35
|
# Makes testing easy via `bundle exec guard`
|
36
|
-
spec.add_development_dependency
|
37
|
-
spec.add_development_dependency
|
36
|
+
spec.add_development_dependency "guard", "~> 2.14"
|
37
|
+
spec.add_development_dependency "guard-rspec", "~> 4.7"
|
38
38
|
|
39
39
|
# If you want to work on older builds of ruby
|
40
|
-
spec.add_development_dependency
|
40
|
+
spec.add_development_dependency "listen", "3.0.7"
|
41
41
|
|
42
42
|
# This gives you the chance to run a REPL inside your tests
|
43
43
|
# via:
|
@@ -46,6 +46,6 @@ Gem::Specification.new do |spec|
|
|
46
46
|
# binding.pry
|
47
47
|
#
|
48
48
|
# This will stop test execution and let you inspect the results
|
49
|
-
spec.add_development_dependency
|
49
|
+
spec.add_development_dependency "pry"
|
50
50
|
end
|
51
51
|
# rubocop:enable Metrics/LineLength
|
@@ -1 +1 @@
|
|
1
|
-
require
|
1
|
+
require "missed_localizable_strings/gem_version"
|
data/lib/danger_plugin.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
require
|
1
|
+
require "missed_localizable_strings/plugin"
|
@@ -45,7 +45,7 @@ module Danger
|
|
45
45
|
missed_keyes = most_modified_strings_keys - modified_keyes
|
46
46
|
next if missed_keyes.empty?
|
47
47
|
missed_keyes.each do |key|
|
48
|
-
missed_entries << {
|
48
|
+
missed_entries << { "file" => file_name, "key" => key }
|
49
49
|
end
|
50
50
|
end
|
51
51
|
missed_entries
|
@@ -66,8 +66,8 @@ module Danger
|
|
66
66
|
message << "| ---- | --- |\n"
|
67
67
|
|
68
68
|
missed_entries.each do |entry|
|
69
|
-
file = entry[
|
70
|
-
key = entry[
|
69
|
+
file = entry["file"]
|
70
|
+
key = entry["key"]
|
71
71
|
|
72
72
|
message << "| #{file} | #{key.strip} | \n"
|
73
73
|
end
|
@@ -83,10 +83,10 @@ module Danger
|
|
83
83
|
lines = File.readlines(file)
|
84
84
|
|
85
85
|
# Grab just the keys, we don't need the translation
|
86
|
-
keys = lines.map { |e| e.split(
|
86
|
+
keys = lines.map { |e| e.split("=").first }
|
87
87
|
# Filter newlines and comments
|
88
88
|
keys = keys.select do |e|
|
89
|
-
e != "\n" && !e.start_with?(
|
89
|
+
e != "\n" && !e.start_with?("/*") && !e.start_with?("//")
|
90
90
|
end
|
91
91
|
keys_from_file[file] = keys
|
92
92
|
end
|
@@ -95,7 +95,7 @@ module Danger
|
|
95
95
|
|
96
96
|
def not_deleted_localizable_files
|
97
97
|
files = (git.modified_files + git.added_files) - git.deleted_files
|
98
|
-
localizable_files = files.select { |line| line.end_with?(
|
98
|
+
localizable_files = files.select { |line| line.end_with?(".strings") }
|
99
99
|
localizable_files
|
100
100
|
end
|
101
101
|
end
|
@@ -1,98 +1,98 @@
|
|
1
|
-
require File.expand_path(
|
1
|
+
require File.expand_path("../spec_helper", __FILE__)
|
2
2
|
|
3
3
|
module Danger
|
4
4
|
describe Danger::DangerMissedLocalizableStrings do
|
5
|
-
it
|
5
|
+
it "should be a plugin" do
|
6
6
|
plugin = Danger::DangerMissedLocalizableStrings.new(nil)
|
7
7
|
expect(plugin).to be_a Danger::Plugin
|
8
8
|
end
|
9
9
|
|
10
|
-
describe
|
10
|
+
describe "with Dangerfile" do
|
11
11
|
before do
|
12
12
|
@dangerfile = testing_dangerfile
|
13
13
|
@my_plugin = @dangerfile.missed_localizable_strings
|
14
14
|
allow(@my_plugin.git).to receive(:deleted_files).and_return([])
|
15
15
|
end
|
16
16
|
|
17
|
-
context
|
17
|
+
context "when there are no Localizable.strings in changeset" do
|
18
18
|
before do
|
19
19
|
allow(@my_plugin.git).to receive(:modified_files)
|
20
|
-
.and_return([
|
20
|
+
.and_return(["spec/fixtures/SomeModifiedFile.swift"])
|
21
21
|
allow(@my_plugin.git).to receive(:added_files)
|
22
|
-
.and_return([
|
22
|
+
.and_return(["spec/fixtures/AddedFile.m"])
|
23
23
|
@my_plugin.check_localizable_omissions
|
24
24
|
end
|
25
25
|
|
26
|
-
it
|
26
|
+
it "does not warn about missed entries in Localizable.strings" do
|
27
27
|
expect(@my_plugin.status_report[:markdowns].first).to be_nil
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
31
|
-
context
|
31
|
+
context "when there is one Localizable.strings file in changeset" do
|
32
32
|
before do
|
33
33
|
allow(@my_plugin.git).to receive(:modified_files)
|
34
|
-
.and_return([
|
34
|
+
.and_return(["spec/fixtures/SomeModifiedFile.swift"])
|
35
35
|
allow(@my_plugin.git).to receive(:added_files)
|
36
|
-
.and_return([
|
36
|
+
.and_return(["spec/fixtures/LocalizableOrigin.strings"])
|
37
37
|
@my_plugin.check_localizable_omissions
|
38
38
|
end
|
39
39
|
|
40
|
-
it
|
40
|
+
it "does not warn about missed entries in Localizable.strings" do
|
41
41
|
expect(@my_plugin.status_report[:markdowns].first).to be_nil
|
42
42
|
end
|
43
43
|
end
|
44
44
|
|
45
|
-
context
|
46
|
-
context
|
45
|
+
context "when there are multiple Localizable.strings in changeset" do
|
46
|
+
context "when there are no missed keys in these files" do
|
47
47
|
before do
|
48
48
|
allow(@my_plugin.git).to receive(:modified_files)
|
49
|
-
.and_return([
|
49
|
+
.and_return(["spec/fixtures/LocalizableWithoutOmissions.strings"])
|
50
50
|
allow(@my_plugin.git).to receive(:added_files)
|
51
|
-
.and_return([
|
51
|
+
.and_return(["spec/fixtures/LocalizableOrigin.strings"])
|
52
52
|
@my_plugin.check_localizable_omissions
|
53
53
|
end
|
54
54
|
|
55
|
-
it
|
55
|
+
it "does not warn about missed entries in Localizable.strings" do
|
56
56
|
expect(@my_plugin.status_report[:markdowns].first).to be_nil
|
57
57
|
end
|
58
58
|
end
|
59
59
|
|
60
|
-
context
|
60
|
+
context "when there are missed keys in these files" do
|
61
61
|
before do
|
62
|
-
file1 =
|
63
|
-
file2 =
|
62
|
+
file1 = "spec/fixtures/LocalizableWithOmissions1.strings"
|
63
|
+
file2 = "spec/fixtures/LocalizableWithOmissions2.strings"
|
64
64
|
allow(@my_plugin.git).to receive(:modified_files)
|
65
65
|
.and_return([file1, file2])
|
66
66
|
allow(@my_plugin.git).to receive(:added_files)
|
67
|
-
.and_return([
|
67
|
+
.and_return(["spec/fixtures/LocalizableOrigin.strings"])
|
68
68
|
@my_plugin.check_localizable_omissions
|
69
69
|
@output = @my_plugin.status_report[:markdowns].first
|
70
70
|
end
|
71
71
|
|
72
|
-
it
|
72
|
+
it "warns about missed entries in Localizable.strings" do
|
73
73
|
expect(@output).to_not be_nil
|
74
74
|
end
|
75
75
|
|
76
|
-
it
|
77
|
-
title =
|
76
|
+
it "contains header" do
|
77
|
+
title = "Found missed keyes in Localizable.strings files"
|
78
78
|
expect(@output.to_s).to include(title)
|
79
79
|
end
|
80
80
|
|
81
|
-
it
|
82
|
-
file =
|
83
|
-
key =
|
81
|
+
it "contains information about the first key from first file" do
|
82
|
+
file = "spec/fixtures/LocalizableWithOmissions1.strings"
|
83
|
+
key = "Day"
|
84
84
|
expect(@output.to_s).to include("| #{file} | \"#{key}\" |")
|
85
85
|
end
|
86
86
|
|
87
|
-
it
|
88
|
-
file =
|
89
|
-
key =
|
87
|
+
it "contains infromation about the second key from first file" do
|
88
|
+
file = "spec/fixtures/LocalizableWithOmissions1.strings"
|
89
|
+
key = "Year"
|
90
90
|
expect(@output.to_s).to include("| #{file} | \"#{key}\" |")
|
91
91
|
end
|
92
92
|
|
93
|
-
it
|
94
|
-
file =
|
95
|
-
key =
|
93
|
+
it "contains infromation about the first key from second file" do
|
94
|
+
file = "spec/fixtures/LocalizableWithOmissions2.strings"
|
95
|
+
key = "Hello"
|
96
96
|
expect(@output.to_s).to include("| #{file} | \"#{key}\" |")
|
97
97
|
end
|
98
98
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,22 +1,22 @@
|
|
1
|
-
require
|
2
|
-
ROOT = Pathname.new(File.expand_path(
|
3
|
-
$LOAD_PATH.unshift((ROOT +
|
4
|
-
$LOAD_PATH.unshift((ROOT +
|
1
|
+
require "pathname"
|
2
|
+
ROOT = Pathname.new(File.expand_path("../../", __FILE__))
|
3
|
+
$LOAD_PATH.unshift((ROOT + "lib").to_s)
|
4
|
+
$LOAD_PATH.unshift((ROOT + "spec").to_s)
|
5
5
|
|
6
|
-
require
|
7
|
-
require
|
6
|
+
require "bundler/setup"
|
7
|
+
require "pry"
|
8
8
|
|
9
|
-
require
|
10
|
-
require
|
9
|
+
require "rspec"
|
10
|
+
require "danger"
|
11
11
|
|
12
12
|
# Use coloured output, it's the best.
|
13
13
|
RSpec.configure do |config|
|
14
|
-
config.filter_gems_from_backtrace
|
14
|
+
config.filter_gems_from_backtrace "bundler"
|
15
15
|
config.color = true
|
16
16
|
config.tty = true
|
17
17
|
end
|
18
18
|
|
19
|
-
require
|
19
|
+
require "danger_plugin"
|
20
20
|
|
21
21
|
# These functions are a subset of https://github.com/danger/danger/blob/master/spec/spec_helper.rb
|
22
22
|
# If you are expanding these files, see if it's already been done ^.
|
@@ -34,7 +34,7 @@ def testing_ui
|
|
34
34
|
|
35
35
|
cork = Cork::Board.new(out: @output)
|
36
36
|
def cork.string
|
37
|
-
out.string.gsub(/\e\[([;\d]+)?m/,
|
37
|
+
out.string.gsub(/\e\[([;\d]+)?m/, "")
|
38
38
|
end
|
39
39
|
cork
|
40
40
|
end
|
@@ -44,11 +44,11 @@ end
|
|
44
44
|
# running a PR on TravisCI
|
45
45
|
def testing_env
|
46
46
|
{
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
47
|
+
"HAS_JOSH_K_SEAL_OF_APPROVAL" => "true",
|
48
|
+
"TRAVIS_PULL_REQUEST" => "800",
|
49
|
+
"TRAVIS_REPO_SLUG" => "artsy/eigen",
|
50
|
+
"TRAVIS_COMMIT_RANGE" => "759adcbd0d8f...13c4dc8bb61d",
|
51
|
+
"DANGER_GITHUB_API_TOKEN" => "123sbdq54erfsd3422gdfio"
|
52
52
|
}
|
53
53
|
end
|
54
54
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: danger-missed_localizable_strings
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anton Domashnev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-05-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: danger-plugin-api
|
@@ -158,6 +158,7 @@ extensions: []
|
|
158
158
|
extra_rdoc_files: []
|
159
159
|
files:
|
160
160
|
- ".gitignore"
|
161
|
+
- ".rubocop.yml"
|
161
162
|
- ".travis.yml"
|
162
163
|
- ".yardoc/checksums"
|
163
164
|
- ".yardoc/complete"
|