flutter_rb 1.1.1 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +42 -8
- data/bin/frb +1 -16
- data/lib/checkstyle_report/checkstyle_report.rb +78 -36
- data/lib/flutter_rb/checks/check.rb +16 -16
- data/lib/flutter_rb/checks/plugin_directories_check.rb +16 -12
- data/lib/flutter_rb/checks/plugin_gradle_check.rb +37 -22
- data/lib/flutter_rb/checks/plugin_podspec_check.rb +78 -47
- data/lib/flutter_rb/checks/plugin_pubspec_check.rb +110 -70
- data/lib/flutter_rb/config/flutter_rb_config.rb +15 -5
- data/lib/flutter_rb/config/flutter_rb_config_initializer.rb +11 -7
- data/lib/flutter_rb/project/project.rb +37 -10
- data/lib/flutter_rb/project/specs/android/android_folder.rb +14 -3
- data/lib/flutter_rb/project/specs/android/gradle.rb +35 -11
- data/lib/flutter_rb/project/specs/flutter/dev_dependency.rb +14 -4
- data/lib/flutter_rb/project/specs/flutter/platform_plugin.rb +24 -6
- data/lib/flutter_rb/project/specs/flutter/pubspec.rb +47 -16
- data/lib/flutter_rb/project/specs/flutter/pubspec_info.rb +27 -7
- data/lib/flutter_rb/project/specs/ios/ios_folder.rb +18 -4
- data/lib/flutter_rb/project/specs/ios/podspec.rb +44 -10
- data/lib/flutter_rb/report/check_report.rb +32 -10
- data/lib/flutter_rb.rb +42 -40
- metadata +16 -2
@@ -4,124 +4,155 @@ require_relative 'check'
|
|
4
4
|
require_relative '../report/check_report'
|
5
5
|
|
6
6
|
module FlutterRb
|
7
|
-
#
|
7
|
+
# This class represents a check for Flutter plugin's podspec file.
|
8
|
+
# It is an abstract class and should be subclassed to perform specific checks.
|
8
9
|
class PluginPodspecCheck < Check
|
9
|
-
#
|
10
|
+
# Returns the name of the check.
|
11
|
+
# The name is constructed by appending the capitalized podspec_parameter to "PluginPodspecCheck".
|
12
|
+
#
|
13
|
+
# @return [String] the name of the check
|
10
14
|
def name
|
11
15
|
"PluginPodspec#{podspec_parameter.capitalize}Check"
|
12
16
|
end
|
13
17
|
|
14
|
-
#
|
18
|
+
# Returns the parameter for which the check is performed in the podspec file.
|
19
|
+
# This method should be implemented in subclasses to specify the specific parameter.
|
20
|
+
#
|
21
|
+
# @raise [RuntimeError] if the method is not implemented in a subclass
|
22
|
+
# @return [String] the parameter for which the check is performed
|
15
23
|
def podspec_parameter
|
16
|
-
UNIMPLEMENTED_ERROR
|
24
|
+
raise UNIMPLEMENTED_ERROR
|
17
25
|
end
|
18
26
|
|
19
|
-
#
|
20
|
-
|
27
|
+
# Returns the description of the check.
|
28
|
+
# The description explains the purpose of the check,
|
29
|
+
# which is to validate a specific parameter in the Flutter plugin's podspec file.
|
30
|
+
#
|
31
|
+
# @return [String] the description of the check
|
32
|
+
def description
|
21
33
|
"Validate Flutter plugin's #{podspec_parameter} in podspec file"
|
22
34
|
end
|
23
35
|
end
|
24
36
|
|
25
|
-
#
|
37
|
+
# This class represents a check for Flutter plugin's name in the podspec file.
|
38
|
+
# It is a subclass of PluginPodspecCheck and overrides the necessary methods to perform the specific check.
|
26
39
|
class PluginPodspecNameCheck < PluginPodspecCheck
|
27
|
-
#
|
40
|
+
# Returns the parameter for which the check is performed in the podspec file.
|
41
|
+
# In this case, it returns 'name'.
|
42
|
+
#
|
43
|
+
# @return [String] the parameter for which the check is performed
|
28
44
|
def podspec_parameter
|
29
45
|
'name'
|
30
46
|
end
|
31
47
|
|
32
|
-
#
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
# @param
|
38
|
-
# @return
|
48
|
+
# Performs the check for the plugin's name in the podspec file.
|
49
|
+
# It compares the name in the pubspec file with the name in the podspec file.
|
50
|
+
# If they match, it returns a CheckReport with a normal status.
|
51
|
+
# If they do not match, it returns a CheckReport with a warning status.
|
52
|
+
#
|
53
|
+
# @param project [Project] the project for which the check is performed
|
54
|
+
# @return [CheckReport] the report of the check
|
39
55
|
def check(project)
|
40
56
|
name_in_pubspec = project.pubspec.pubspec_info.name
|
41
57
|
podspec = project.ios_folder.podspec
|
42
58
|
name_in_podspec = podspec.name
|
59
|
+
|
43
60
|
CheckReport.new(
|
44
61
|
name,
|
45
|
-
name_in_pubspec == name_in_podspec ? CheckReportStatus::NORMAL : CheckReportStatus::WARNING,
|
62
|
+
name_in_pubspec == name_in_podspec ? ::CheckReportStatus::NORMAL : ::CheckReportStatus::WARNING,
|
46
63
|
description,
|
47
64
|
podspec.path
|
48
65
|
)
|
49
66
|
end
|
50
67
|
end
|
51
68
|
|
52
|
-
#
|
69
|
+
# This class represents a check for Flutter plugin's version in the podspec file.
|
70
|
+
# It is a subclass of PluginPodspecCheck and overrides the necessary methods to perform the specific check.
|
53
71
|
class PluginPodspecVersionCheck < PluginPodspecCheck
|
54
|
-
#
|
72
|
+
# Returns the parameter for which the check is performed in the podspec file.
|
73
|
+
# In this case, it returns 'version'.
|
74
|
+
#
|
75
|
+
# @return [String] the parameter for which the check is performed
|
55
76
|
def podspec_parameter
|
56
77
|
'version'
|
57
78
|
end
|
58
79
|
|
59
|
-
#
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
# @param
|
65
|
-
# @return
|
80
|
+
# Performs the check for the plugin's version in the podspec file.
|
81
|
+
# It compares the version in the pubspec file with the version in the podspec file.
|
82
|
+
# If they match, it returns a CheckReport with a normal status.
|
83
|
+
# If they do not match, it returns a CheckReport with a warning status.
|
84
|
+
#
|
85
|
+
# @param project [Project] the project for which the check is performed
|
86
|
+
# @return [CheckReport] the report of the check
|
66
87
|
def check(project)
|
67
88
|
version_in_pubspec = project.pubspec.pubspec_info.version
|
68
89
|
podspec = project.ios_folder.podspec
|
69
90
|
version_in_podspec = podspec.version
|
91
|
+
|
70
92
|
CheckReport.new(
|
71
93
|
name,
|
72
|
-
version_in_pubspec == version_in_podspec ? CheckReportStatus::NORMAL : CheckReportStatus::WARNING,
|
94
|
+
version_in_pubspec == version_in_podspec ? ::CheckReportStatus::NORMAL : ::CheckReportStatus::WARNING,
|
73
95
|
description,
|
74
96
|
podspec.path
|
75
97
|
)
|
76
98
|
end
|
77
99
|
end
|
78
100
|
|
79
|
-
#
|
101
|
+
# This class represents a check for Flutter plugin's authors in the podspec file.
|
102
|
+
# It is a subclass of PluginPodspecCheck and overrides the necessary methods to perform the specific check.
|
80
103
|
class PluginPodspecAuthorsCheck < PluginPodspecCheck
|
81
|
-
#
|
104
|
+
# Returns the parameter for which the check is performed in the podspec file.
|
105
|
+
# In this case, it returns 'authors'.
|
106
|
+
#
|
107
|
+
# @return [String] the parameter for which the check is performed
|
82
108
|
def podspec_parameter
|
83
109
|
'authors'
|
84
110
|
end
|
85
111
|
|
86
|
-
#
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
# @param
|
92
|
-
# @return
|
112
|
+
# Performs the check for the plugin's authors in the podspec file.
|
113
|
+
# It checks if the 'authors' parameter is present in the podspec file.
|
114
|
+
# If it is present, it returns a CheckReport with a normal status.
|
115
|
+
# If it is not present, it returns a CheckReport with an error status.
|
116
|
+
#
|
117
|
+
# @param project [Project] the project for which the check is performed
|
118
|
+
# @return [CheckReport] the report of the check
|
93
119
|
def check(project)
|
94
120
|
podspec = project.ios_folder.podspec
|
95
121
|
author_exists = !podspec.authors.nil?
|
122
|
+
|
96
123
|
CheckReport.new(
|
97
124
|
name,
|
98
|
-
author_exists ? CheckReportStatus::NORMAL : CheckReportStatus::ERROR,
|
125
|
+
author_exists ? ::CheckReportStatus::NORMAL : ::CheckReportStatus::ERROR,
|
99
126
|
description,
|
100
127
|
podspec.path
|
101
128
|
)
|
102
129
|
end
|
103
130
|
end
|
104
131
|
|
105
|
-
#
|
106
|
-
#
|
132
|
+
# This class represents a check for Flutter plugin's source in the podspec file.
|
133
|
+
# It is a subclass of PluginPodspecCheck and overrides the necessary methods to perform the specific check.
|
107
134
|
class PluginPodspecSourceCheck < PluginPodspecCheck
|
108
|
-
#
|
135
|
+
# Returns the parameter for which the check is performed in the podspec file.
|
136
|
+
# In this case, it returns 'source'.
|
137
|
+
#
|
138
|
+
# @return [String] the parameter for which the check is performed
|
109
139
|
def podspec_parameter
|
110
140
|
'source'
|
111
141
|
end
|
112
142
|
|
113
|
-
#
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
# @param
|
119
|
-
# @return
|
143
|
+
# Performs the check for the plugin's source in the podspec file.
|
144
|
+
# It checks if the 'source' parameter is present in the podspec file.
|
145
|
+
# If it is present, it returns a CheckReport with a normal status.
|
146
|
+
# If it is not present, it returns a CheckReport with an error status.
|
147
|
+
#
|
148
|
+
# @param project [Project] the project for which the check is performed
|
149
|
+
# @return [CheckReport] the report of the check
|
120
150
|
def check(project)
|
121
151
|
podspec = project.ios_folder.podspec
|
152
|
+
|
122
153
|
CheckReport.new(
|
123
154
|
name,
|
124
|
-
podspec.source.nil? ? CheckReportStatus::ERROR : CheckReportStatus::NORMAL,
|
155
|
+
podspec.source.nil? ? ::CheckReportStatus::ERROR : ::CheckReportStatus::NORMAL,
|
125
156
|
description,
|
126
157
|
podspec.path
|
127
158
|
)
|
@@ -4,40 +4,54 @@ require_relative 'check'
|
|
4
4
|
require_relative '../report/check_report'
|
5
5
|
|
6
6
|
module FlutterRb
|
7
|
-
#
|
7
|
+
# This class represents a check for Flutter plugin's pubspec.yaml file.
|
8
|
+
# It is an abstract class and should be subclassed to perform specific checks.
|
8
9
|
class PluginPubspecCheck < Check
|
9
|
-
#
|
10
|
+
# Returns the name of the check.
|
11
|
+
# The name is constructed by appending the capitalized pubspec_parameter to "PluginPubspecCheck".
|
12
|
+
#
|
13
|
+
# @return [String] the name of the check
|
10
14
|
def name
|
11
15
|
"PluginPubspec#{pubspec_parameter.capitalize}Check"
|
12
16
|
end
|
13
17
|
|
14
|
-
#
|
18
|
+
# Returns the parameter to be checked in the pubspec.yaml file.
|
19
|
+
# This method should be implemented in subclasses to specify the specific parameter to be checked.
|
20
|
+
#
|
21
|
+
# @raise [NotImplementedError] if not implemented in subclasses
|
22
|
+
# @return [String] the parameter to be checked
|
15
23
|
def pubspec_parameter
|
16
24
|
raise UNIMPLEMENTED_ERROR
|
17
25
|
end
|
18
26
|
|
19
|
-
#
|
20
|
-
|
27
|
+
# Returns the description of the check.
|
28
|
+
# The description explains what the check is validating.
|
29
|
+
#
|
30
|
+
# @return [String] the description of the check
|
31
|
+
def description
|
21
32
|
"Validate Flutter plugin's #{pubspec_parameter} in pubspec.yaml"
|
22
33
|
end
|
23
34
|
end
|
24
35
|
|
25
|
-
#
|
36
|
+
# This class represents a check for Flutter plugin's pubspec.yaml file for 'name' parameter.
|
37
|
+
# It inherits from PluginPubspecCheck class.
|
26
38
|
class PluginPubspecNameCheck < PluginPubspecCheck
|
27
|
-
#
|
39
|
+
# Returns the parameter to be checked in the pubspec.yaml file.
|
40
|
+
# In this case, it returns 'name'.
|
41
|
+
#
|
42
|
+
# @return [String] the parameter to be checked
|
28
43
|
def pubspec_parameter
|
29
44
|
'name'
|
30
45
|
end
|
31
46
|
|
32
|
-
#
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
# @param {Project} project
|
38
|
-
# @return {CheckReport}
|
47
|
+
# Performs the check for the 'name' parameter in the pubspec.yaml file.
|
48
|
+
# It creates a CheckReport object with the result of the check.
|
49
|
+
#
|
50
|
+
# @param project [Project] the project to be checked
|
51
|
+
# @return [CheckReport] the report of the check result
|
39
52
|
def check(project)
|
40
53
|
pubspec = project.pubspec
|
54
|
+
|
41
55
|
CheckReport.new(
|
42
56
|
name,
|
43
57
|
pubspec.pubspec_info.name.nil? ? CheckReportStatus::ERROR : CheckReportStatus::NORMAL,
|
@@ -47,22 +61,25 @@ module FlutterRb
|
|
47
61
|
end
|
48
62
|
end
|
49
63
|
|
50
|
-
#
|
64
|
+
# This class represents a check for Flutter plugin's pubspec.yaml file for 'description' parameter.
|
65
|
+
# It inherits from PluginPubspecCheck class.
|
51
66
|
class PluginPubspecDescriptionCheck < PluginPubspecCheck
|
52
|
-
#
|
67
|
+
# Returns the parameter to be checked in the pubspec.yaml file.
|
68
|
+
# In this case, it returns 'description'.
|
69
|
+
#
|
70
|
+
# @return [String] the parameter to be checked
|
53
71
|
def pubspec_parameter
|
54
72
|
'description'
|
55
73
|
end
|
56
74
|
|
57
|
-
#
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
# @param {Project} project
|
63
|
-
# @return {CheckReport}
|
75
|
+
# Performs the check for the 'description' parameter in the pubspec.yaml file.
|
76
|
+
# It creates a CheckReport object with the result of the check.
|
77
|
+
#
|
78
|
+
# @param project [Project] the project to be checked
|
79
|
+
# @return [CheckReport] the report of the check result
|
64
80
|
def check(project)
|
65
81
|
pubspec = project.pubspec
|
82
|
+
|
66
83
|
CheckReport.new(
|
67
84
|
name,
|
68
85
|
pubspec.pubspec_info.description.nil? ? CheckReportStatus::WARNING : CheckReportStatus::NORMAL,
|
@@ -72,22 +89,25 @@ module FlutterRb
|
|
72
89
|
end
|
73
90
|
end
|
74
91
|
|
75
|
-
#
|
92
|
+
# This class represents a check for Flutter plugin's pubspec.yaml file for 'version' parameter.
|
93
|
+
# It inherits from PluginPubspecCheck class.
|
76
94
|
class PluginPubspecVersionCheck < PluginPubspecCheck
|
77
|
-
#
|
95
|
+
# Returns the parameter to be checked in the pubspec.yaml file.
|
96
|
+
# In this case, it returns 'version'.
|
97
|
+
#
|
98
|
+
# @return [String] the parameter to be checked
|
78
99
|
def pubspec_parameter
|
79
100
|
'version'
|
80
101
|
end
|
81
102
|
|
82
|
-
#
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
# @param {Project} project
|
88
|
-
# @return {CheckReport}
|
103
|
+
# Performs the check for the 'version' parameter in the pubspec.yaml file.
|
104
|
+
# It creates a CheckReport object with the result of the check.
|
105
|
+
#
|
106
|
+
# @param project [Project] the project to be checked
|
107
|
+
# @return [CheckReport] the report of the check result
|
89
108
|
def check(project)
|
90
109
|
pubspec = project.pubspec
|
110
|
+
|
91
111
|
CheckReport.new(
|
92
112
|
name,
|
93
113
|
pubspec.pubspec_info.version.nil? ? CheckReportStatus::ERROR : CheckReportStatus::NORMAL,
|
@@ -97,22 +117,25 @@ module FlutterRb
|
|
97
117
|
end
|
98
118
|
end
|
99
119
|
|
100
|
-
#
|
120
|
+
# This class represents a check for Flutter plugin's pubspec.yaml file for 'author' parameter.
|
121
|
+
# It inherits from PluginPubspecCheck class.
|
101
122
|
class PluginPubspecAuthorCheck < PluginPubspecCheck
|
102
|
-
#
|
123
|
+
# Returns the parameter to be checked in the pubspec.yaml file.
|
124
|
+
# In this case, it returns 'author'.
|
125
|
+
#
|
126
|
+
# @return [String] the parameter to be checked
|
103
127
|
def pubspec_parameter
|
104
128
|
'author'
|
105
129
|
end
|
106
130
|
|
107
|
-
#
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
# @param {Project} project
|
113
|
-
# @return {CheckReport}
|
131
|
+
# Performs the check for the 'author' parameter in the pubspec.yaml file.
|
132
|
+
# It creates a CheckReport object with the result of the check.
|
133
|
+
#
|
134
|
+
# @param project [Project] the project to be checked
|
135
|
+
# @return [CheckReport] the report of the check result
|
114
136
|
def check(project)
|
115
137
|
pubspec = project.pubspec
|
138
|
+
|
116
139
|
CheckReport.new(
|
117
140
|
name,
|
118
141
|
pubspec.pubspec_info.author.nil? ? CheckReportStatus::NORMAL : CheckReportStatus::WARNING,
|
@@ -122,22 +145,25 @@ module FlutterRb
|
|
122
145
|
end
|
123
146
|
end
|
124
147
|
|
125
|
-
#
|
148
|
+
# This class represents a check for Flutter plugin's pubspec.yaml file for 'homepage' parameter.
|
149
|
+
# It inherits from PluginPubspecCheck class.
|
126
150
|
class PluginPubspecHomepageCheck < PluginPubspecCheck
|
127
|
-
#
|
151
|
+
# Returns the parameter to be checked in the pubspec.yaml file.
|
152
|
+
# In this case, it returns 'homepage'.
|
153
|
+
#
|
154
|
+
# @return [String] the parameter to be checked
|
128
155
|
def pubspec_parameter
|
129
156
|
'homepage'
|
130
157
|
end
|
131
158
|
|
132
|
-
#
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
# @param {Project} project
|
138
|
-
# @return {CheckReport}
|
159
|
+
# Performs the check for the 'homepage' parameter in the pubspec.yaml file.
|
160
|
+
# It creates a CheckReport object with the result of the check.
|
161
|
+
#
|
162
|
+
# @param project [Project] the project to be checked
|
163
|
+
# @return [CheckReport] the report of the check result
|
139
164
|
def check(project)
|
140
165
|
pubspec = project.pubspec
|
166
|
+
|
141
167
|
CheckReport.new(
|
142
168
|
name,
|
143
169
|
pubspec.pubspec_info.homepage.nil? ? CheckReportStatus::ERROR : CheckReportStatus::NORMAL,
|
@@ -147,30 +173,37 @@ module FlutterRb
|
|
147
173
|
end
|
148
174
|
end
|
149
175
|
|
150
|
-
#
|
176
|
+
# This class represents a check for Flutter plugin's pubspec.yaml file for 'lints' dependency.
|
177
|
+
# It inherits from the Check class.
|
151
178
|
class PluginPubspecLintsCheck < Check
|
152
|
-
#
|
179
|
+
# Returns the name of the check.
|
180
|
+
#
|
181
|
+
# @return [String] the name of the check
|
153
182
|
def name
|
154
183
|
'PluginPubspecLintsCheck'
|
155
184
|
end
|
156
185
|
|
157
|
-
#
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
# @return {String}
|
186
|
+
# Returns the description of the check.
|
187
|
+
# The description explains what the check is validating.
|
188
|
+
#
|
189
|
+
# @return [String] the description of the check
|
163
190
|
def description
|
164
191
|
'Check Flutter plugin lints dependency in pubspec file'
|
165
192
|
end
|
166
193
|
|
167
|
-
#
|
168
|
-
#
|
194
|
+
# Performs the check for the 'lints' dependency in the pubspec.yaml file.
|
195
|
+
# It creates a CheckReport object with the result of the check.
|
196
|
+
#
|
197
|
+
# @param project [Project] the project to be checked
|
198
|
+
# @return [CheckReport] the report of the check result
|
169
199
|
def check(project)
|
170
200
|
pubspec = project.pubspec
|
201
|
+
# Detects if 'lints' is a dependency in the pubspec file
|
171
202
|
lints = pubspec.dev_dependencies&.detect do |dev_dependency|
|
172
203
|
dev_dependency.name == 'lints'
|
173
204
|
end
|
205
|
+
|
206
|
+
# Creates a CheckReport object with the result of the check
|
174
207
|
CheckReport.new(
|
175
208
|
name,
|
176
209
|
lints.nil? ? CheckReportStatus::ERROR : CheckReportStatus::NORMAL,
|
@@ -180,30 +213,37 @@ module FlutterRb
|
|
180
213
|
end
|
181
214
|
end
|
182
215
|
|
183
|
-
#
|
216
|
+
# This class represents a check for Flutter plugin's pubspec.yaml file for 'flutter_lints' dependency.
|
217
|
+
# It inherits from the Check class.
|
184
218
|
class PluginPubspecFlutterLintsCheck < Check
|
185
|
-
#
|
219
|
+
# Returns the name of the check.
|
220
|
+
#
|
221
|
+
# @return [String] the name of the check
|
186
222
|
def name
|
187
223
|
'PluginPubspecFlutterLintsCheck'
|
188
224
|
end
|
189
225
|
|
190
|
-
#
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
# @return {String}
|
226
|
+
# Returns the description of the check.
|
227
|
+
# The description explains what the check is validating.
|
228
|
+
#
|
229
|
+
# @return [String] the description of the check
|
196
230
|
def description
|
197
231
|
'Check Flutter plugin flutter_lints dependency in pubspec file'
|
198
232
|
end
|
199
233
|
|
200
|
-
#
|
201
|
-
#
|
234
|
+
# Performs the check for the 'flutter_lints' dependency in the pubspec.yaml file.
|
235
|
+
# It creates a CheckReport object with the result of the check.
|
236
|
+
#
|
237
|
+
# @param project [Project] the project to be checked
|
238
|
+
# @return [CheckReport] the report of the check result
|
202
239
|
def check(project)
|
203
240
|
pubspec = project.pubspec
|
241
|
+
# Detects if 'flutter_lints' is a dependency in the pubspec file
|
204
242
|
flutter_lints = pubspec.dev_dependencies&.detect do |dev_dependency|
|
205
243
|
dev_dependency.name == 'flutter_lints'
|
206
244
|
end
|
245
|
+
|
246
|
+
# Creates a CheckReport object with the result of the check
|
207
247
|
CheckReport.new(
|
208
248
|
name,
|
209
249
|
flutter_lints.nil? ? CheckReportStatus::ERROR : CheckReportStatus::NORMAL,
|
@@ -1,17 +1,27 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module FlutterRb
|
4
|
-
#
|
4
|
+
# This class represents the configuration for FlutterRb checks.
|
5
|
+
# It holds arrays of checks for Flutter, Android, and iOS platforms.
|
5
6
|
class FlutterRbConfig
|
6
|
-
#
|
7
|
-
#
|
8
|
-
# @param
|
7
|
+
# Initializes a new instance of FlutterRbConfig.
|
8
|
+
#
|
9
|
+
# @param flutter_checks [Array<Check>] An array of Flutter checks.
|
10
|
+
# @param android_checks [Array<Check>] An array of Android checks.
|
11
|
+
# @param ios_checks [Array<Check>] An array of iOS checks.
|
9
12
|
def initialize(flutter_checks, android_checks, ios_checks)
|
10
13
|
@flutter_checks = flutter_checks
|
11
14
|
@android_checks = android_checks
|
12
15
|
@ios_checks = ios_checks
|
13
16
|
end
|
14
17
|
|
15
|
-
|
18
|
+
# Provides read and write access to the flutter_checks attribute.
|
19
|
+
attr_accessor :flutter_checks
|
20
|
+
|
21
|
+
# Provides read and write access to the android_checks attribute.
|
22
|
+
attr_accessor :android_checks
|
23
|
+
|
24
|
+
# Provides read and write access to the ios_checks attribute.
|
25
|
+
attr_accessor :ios_checks
|
16
26
|
end
|
17
27
|
end
|
@@ -6,8 +6,9 @@ require_relative '../checks/plugin_directories_check'
|
|
6
6
|
require 'yaml'
|
7
7
|
|
8
8
|
module FlutterRb
|
9
|
-
#
|
9
|
+
# This class is responsible for initializing a FlutterRbConfig object.
|
10
10
|
class FlutterRbConfigInitializer
|
11
|
+
# An array of Flutter checks to be performed.
|
11
12
|
FLUTTER_CHECKS = [
|
12
13
|
PluginDirectoriesCheck.new,
|
13
14
|
PluginPubspecNameCheck.new,
|
@@ -19,11 +20,13 @@ module FlutterRb
|
|
19
20
|
PluginPubspecFlutterLintsCheck.new
|
20
21
|
].freeze
|
21
22
|
|
23
|
+
# An array of Android checks to be performed.
|
22
24
|
ANDROID_CHECKS = [
|
23
25
|
PluginGradleAndroidPackageCheck.new,
|
24
26
|
PluginGradleVersionCheck.new
|
25
27
|
].freeze
|
26
28
|
|
29
|
+
# An array of iOS checks to be performed.
|
27
30
|
IOS_CHECKS = [
|
28
31
|
PluginPodspecNameCheck.new,
|
29
32
|
PluginPodspecVersionCheck.new,
|
@@ -31,9 +34,10 @@ module FlutterRb
|
|
31
34
|
PluginPodspecSourceCheck.new
|
32
35
|
].freeze
|
33
36
|
|
34
|
-
#
|
35
|
-
#
|
36
|
-
# @
|
37
|
+
# Parses a YAML configuration file and initializes a FlutterRbConfig object.
|
38
|
+
#
|
39
|
+
# @param path [String] The path to the YAML configuration file.
|
40
|
+
# @return [FlutterRbConfig] A FlutterRbConfig object initialized with the parsed configuration.
|
37
41
|
def parse(path)
|
38
42
|
config = YAML.load_file(path)
|
39
43
|
|
@@ -64,9 +68,9 @@ module FlutterRb
|
|
64
68
|
)
|
65
69
|
end
|
66
70
|
|
67
|
-
#
|
68
|
-
|
69
|
-
# @return
|
71
|
+
# Initializes a FlutterRbConfig object with the default checks.
|
72
|
+
#
|
73
|
+
# @return [FlutterRbConfig] A FlutterRbConfig object initialized with the default checks.
|
70
74
|
def default
|
71
75
|
FlutterRbConfig.new(
|
72
76
|
FLUTTER_CHECKS,
|