flutter_rb 1.0.1 → 1.1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8564b7cdf9819a28ea1ca5c145f9dcb813556575998924fb9b6cc8db5224ca77
4
- data.tar.gz: 51b4cc3dd7dbf3b0d0e7a653f29defc47293b685c3de05f6e5a99ce846df9e41
3
+ metadata.gz: 5d708635770d65db09e97f3864f6e35ebcba46c13c84d6a388e6f10e9adc72e4
4
+ data.tar.gz: 1db4f12f4a0d23ba569a1c885eb3db6b295f11f2954594207750e738c91fa885
5
5
  SHA512:
6
- metadata.gz: 7b595e1256a18e7f74d5d273054f7608dae0c3674bd0467db4108fb4ef7c8936248cd3daf610ac5e11242fe169d97085bd008fee98bb5dca2a2461a72a7f01cc
7
- data.tar.gz: 7b12583d8fad4af058cde7c45e560141a9f74db75fe215f70b57ebe3a0584a7979471a7b68680f7ded6ebdd469cbf4421cfb4822e8d9af29d18fe08f2638fef1
6
+ metadata.gz: ce685d7cfeb7b65bd31113f167d91aa59fb5ba23368f744a4d1efa14d7b2f5e97e32e7b4fa2012a32ba2fafb94f29c6d30e68602e25648aff0fe7695bafc0ce5
7
+ data.tar.gz: 6d11387d9654065b86410ab14612ec2ac4711f181d8c56d9551f762d408b6ba00ba0c1b81f72145af283d970e17b51dafa0c8d545925dae11df65b7630bfd70c
data/README.md CHANGED
@@ -1,3 +1,4 @@
1
+ <!--suppress CheckImageSize -->
1
2
  <img src="media/logo/ic_lib.png" height="100px" alt="Project's logo">
2
3
 
3
4
  # flutter_rb
@@ -5,6 +6,7 @@
5
6
  [![GitHubActions](https://github.com/flutter-rb/flutter-rb/workflows/Build/badge.svg)](https://github.com/flutter-rb/flutter-rb/actions?branch=master)
6
7
  [![Codebeat](https://codebeat.co/badges/9bb32e28-ca86-4cdc-ba66-bda7f989979a)](https://codebeat.co/projects/github-com-flutter-rb-flutter-rb-master)
7
8
  [![Gem Version](https://badge.fury.io/rb/flutter_rb.svg)](https://badge.fury.io/rb/flutter_rb)
9
+ [![Gem Downloads](https://img.shields.io/gem/dt/flutter_rb)](https://badge.fury.io/rb/flutter_rb)
8
10
 
9
11
  ## About
10
12
 
@@ -24,15 +26,16 @@ Each issue has a `level` parameter that describes its significant importance.
24
26
 
25
27
  #### Flutter
26
28
 
27
- | Check | Description | Level |
28
- |-----------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------|
29
- | `PluginDirectoriesCheck` | Check plugin directories structure in pubspec file. Example: if a Flutter plugin has only Android specific code but not contains iOS folder with description, then iOS build fails | `ERROR` |
30
- | `PluginPubspecNameCheck` | Check plugin name in pubspec file. Exists or not | `ERROR` |
31
- | `PluginPubspecDescriptionCheck` | Check plugin description in pubspec file. Exists or not | `WARNING` |
32
- | `PluginPubspecVersionCheck` | Check plugin version in pubspec. Exists or not | `ERROR` |
33
- | `PluginPubspecAuthorCheck` | Check plugin author in pubspec. Exists or not. `author` section deprecated in `pubspec.yaml` | `WARNING` |
34
- | `PluginPubspecHomepageCheck` | Check plugin homepage in pubspec. Exists or not | `ERROR` |
35
- | `PluginPubspecEffectiveDartCheck` | Check Flutter plugin Effective Dart depencency in pubspec file. Exists or not | `ERROR` |
29
+ | Check | Description | Level |
30
+ |----------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------|
31
+ | `PluginDirectoriesCheck` | Check plugin directories structure in pubspec file. Example: if a Flutter plugin has only Android specific code but not contains iOS folder with description, then iOS build fails | `ERROR` |
32
+ | `PluginPubspecNameCheck` | Check plugin name in pubspec file. Exists or not | `ERROR` |
33
+ | `PluginPubspecDescriptionCheck` | Check plugin description in pubspec file. Exists or not | `WARNING` |
34
+ | `PluginPubspecVersionCheck` | Check plugin version in pubspec. Exists or not | `ERROR` |
35
+ | `PluginPubspecAuthorCheck` | Check plugin author in pubspec. Exists or not. `author` section deprecated in `pubspec.yaml` | `WARNING` |
36
+ | `PluginPubspecHomepageCheck` | Check plugin homepage in pubspec. Exists or not | `ERROR` |
37
+ | `PluginPubspecLintsCheck` | Check Flutter plugin `lints` dependency in pubspec file. Exists or not | `ERROR` |
38
+ | `PluginPubspecFlutterLintsCheck` | Check Flutter plugin `flutter_lints` dependency in pubspec file. Exists or not | `ERROR` |
36
39
 
37
40
  #### Android
38
41
 
@@ -54,7 +57,8 @@ Each issue has a `level` parameter that describes its significant importance.
54
57
 
55
58
  ### Android
56
59
 
57
- You should add [flutter-rb-gradle-plugin](https://github.com/flutter-rb/flutter-rb-gradle-plugin) to Android side of your plugin.
60
+ You should add [flutter-rb-gradle-plugin](https://github.com/flutter-rb/flutter-rb-gradle-plugin) to Android side of
61
+ your plugin.
58
62
 
59
63
  ### Download gem from RubyGems
60
64
 
@@ -85,7 +89,8 @@ $ frb
85
89
 
86
90
  ### As local executable
87
91
 
88
- Add `project_folder/bin` (where `project_folder` is path to project on your machine) to `PATH` variable in your environment. Then updated environment and run from a Flutter plugin's project folder:
92
+ Add `project_folder/bin` (where `project_folder` is path to project on your machine) to `PATH` variable in your
93
+ environment. Then updated environment and run from a Flutter plugin's project folder:
89
94
 
90
95
  ```shell
91
96
  $ local_frb
@@ -98,13 +103,12 @@ $ local_frb
98
103
  | `--help` | Print help info |
99
104
  | `--checkstyle-report` | Generate report in Checkstyle format |
100
105
 
101
-
102
106
  ### Configuration
103
107
 
104
- Add `.flutter_rb.yaml` to root of a project for select checks that you are want to execute:
108
+ Add `.flutter_rb.yaml` to root of a project for select checks that you are want to exclude:
105
109
 
106
110
  ```yaml
107
- include:
111
+ exclude:
108
112
  flutter:
109
113
  - check1
110
114
  - check2
@@ -120,11 +124,13 @@ include:
120
124
 
121
125
  ### Output report
122
126
 
123
- Tool can make report in Checkstyle format. To enable this feature, pass `--checkstyle-report` as an CLI argument. The report file name is `frb-checkstyle-report.xml`.
127
+ Tool can make report in Checkstyle format. To enable this feature, pass `--checkstyle-report` as an CLI argument. The
128
+ report file name is `frb-checkstyle-report.xml`.
124
129
 
125
130
  ## How to contribute
126
131
 
127
- Read [Commit Convention](./COMMIT_CONVENTION.md). Make sure your build is green before you contribute your pull request. Then:
132
+ Read [Commit Convention](./COMMIT_CONVENTION.md). Make sure your build is green before you contribute your pull request.
133
+ Then:
128
134
 
129
135
  ```shell
130
136
  $ bundle exec rake
data/bin/frb CHANGED
@@ -1,5 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
+ # frozen_string_literal: true
4
+
3
5
  require 'flutter_rb'
4
6
  require 'colorize'
5
7
 
@@ -1,15 +1,22 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'nokogiri'
2
4
 
3
5
  # Module with classes for creating reports in Checkstyle format
4
6
  module CheckstyleReport
5
7
  # Class for create report in Checkstyle format
6
8
  class CheckstyleReport
9
+ # @param {String} path
10
+ # @param {String} report_filename
11
+ # @param {CheckstyleError[]}
7
12
  def initialize(path, report_filename, checks)
8
13
  @path = path
9
14
  @report_filename = report_filename
10
15
  @checks = checks
11
16
  end
12
17
 
18
+ # rubocop:disable Metrics/MethodLength
19
+ # noinspection RubyResolve
13
20
  def create_report
14
21
  checkstyle_files = sort_checks(@checks)
15
22
  report = Nokogiri::XML::Builder.new do |xml|
@@ -19,9 +26,15 @@ module CheckstyleReport
19
26
  .each { |file| write_file(xml, file) }
20
27
  end
21
28
  end
22
- File.open("#{@path}/#{@report_filename}.xml", 'w') { |file| file.write(report.to_xml) }
29
+ File.open("#{@path}/#{@report_filename}.xml", 'w') do |file|
30
+ file.write(report.to_xml)
31
+ end
23
32
  end
24
33
 
34
+ # rubocop:enable Metrics/MethodLength
35
+
36
+ # @param {CheckstyleError} checks
37
+ # @return {CheckstyleFile[]}
25
38
  def sort_checks(checks)
26
39
  checkstyle_files = {}
27
40
  checks.each do |check|
@@ -32,6 +45,8 @@ module CheckstyleReport
32
45
  checkstyle_files
33
46
  end
34
47
 
48
+ # @param {XML} xml
49
+ # @param {CheckstyleFile} checkstyle_file
35
50
  def write_file(xml, checkstyle_file)
36
51
  xml.file(name: checkstyle_file.file) do
37
52
  checkstyle_file.errors.each do |error|
@@ -40,6 +55,8 @@ module CheckstyleReport
40
55
  end
41
56
  end
42
57
 
58
+ # @param {XML} xml
59
+ # @param {CheckstyleError} error
43
60
  def write_error(xml, error)
44
61
  xml.error(
45
62
  line: error.line,
@@ -53,6 +70,8 @@ module CheckstyleReport
53
70
 
54
71
  # File representation for Checkstyle format
55
72
  class CheckstyleFile
73
+ # @param {String} file
74
+ # @param {CheckstyleError[]} errors
56
75
  def initialize(file, errors)
57
76
  @file = file
58
77
  @errors = errors
@@ -63,11 +82,17 @@ module CheckstyleReport
63
82
 
64
83
  # Checkstyle error representation
65
84
  class CheckstyleError
66
- SEVERITY_NORMAL = 'normal'.freeze
67
- SEVERITY_WARNING = 'warning'.freeze
68
- SEVERITY_ERROR = 'error'.freeze
85
+ SEVERITY_NORMAL = 'normal'
86
+ SEVERITY_WARNING = 'warning'
87
+ SEVERITY_ERROR = 'error'
69
88
 
70
89
  # rubocop:disable Metrics/ParameterLists
90
+ # @param {String} severity
91
+ # @param {String} message
92
+ # @param {String} source
93
+ # @param {Integer} line
94
+ # @param {Integer} column
95
+ # @param {String} name
71
96
  def initialize(
72
97
  severity,
73
98
  message,
@@ -83,6 +108,7 @@ module CheckstyleReport
83
108
  @column = column
84
109
  @name = name
85
110
  end
111
+
86
112
  # rubocop:enable Metrics/ParameterLists
87
113
 
88
114
  attr_reader :severity, :message, :source, :line, :column, :name
@@ -1,24 +1,34 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module FlutterRb
2
4
  # Base class for all checks
3
5
  # Class provides default methods structure
4
6
  # All methods using for create reports
5
7
  class Check
6
- UNIMPLEMENTED_ERROR = 'Error: missing method'.freeze
8
+ UNIMPLEMENTED_ERROR = 'Error: missing method'
7
9
 
10
+ # @return {String}
8
11
  def name
9
12
  raise UNIMPLEMENTED_ERROR
10
13
  end
11
14
 
15
+ # @return {String}
12
16
  def summary
13
17
  raise UNIMPLEMENTED_ERROR
14
18
  end
15
19
 
20
+ # @return {String}
16
21
  def description
17
22
  'No provided'
18
23
  end
19
24
 
20
- def check
25
+ # rubocop:disable Lint/UnusedMethodArgument
26
+ # @param {Project} project
27
+ # @return {CheckReport}
28
+ def check(project)
21
29
  raise UNIMPLEMENTED_ERROR
22
30
  end
31
+
32
+ # rubocop:enable Lint/UnusedMethodArgument
23
33
  end
24
34
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'check'
2
4
  require_relative '../report/check_report'
3
5
 
@@ -6,18 +8,23 @@ module FlutterRb
6
8
  # Example: if a Flutter plugin has only Android specific code
7
9
  # but not contains iOS folder with description, then iOS build fails
8
10
  class PluginDirectoriesCheck < Check
11
+ # @return {String}
9
12
  def name
10
13
  'PluginDirectoriesCheck'
11
14
  end
12
15
 
16
+ # @return {String}
13
17
  def summary
14
18
  'Validate Flutter plugin structure'
15
19
  end
16
20
 
21
+ # @return {String}
17
22
  def description
18
23
  'Check plugin directories structure in pubspec file'
19
24
  end
20
25
 
26
+ # @param {Project} project
27
+ # @return {CheckReport}
21
28
  def check(project)
22
29
  android_exists = !project.android_folder.nil?
23
30
  ios_exists = !project.ios_folder.nil?
@@ -1,21 +1,28 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative './check'
2
4
  require_relative '../report/check_report'
3
5
 
4
6
  module FlutterRb
5
7
  # Check 'android; import not exists in Gradle project config (build.gradle file)
6
8
  class PluginGradleAndroidPackageCheck < Check
9
+ # @return {String}
7
10
  def name
8
11
  'PluginGradleAndroidPackageCheck'
9
12
  end
10
13
 
14
+ # @return {String}
11
15
  def summary
12
16
  'Validate that \android\ package not exists in build.gradle config'
13
17
  end
14
18
 
19
+ # @return {String}
15
20
  def description
16
21
  'Validate that \android\ package not exists in Gradle project config (build.gradle file)'
17
22
  end
18
23
 
24
+ # @param {Project} project
25
+ # @return {CheckReport}
19
26
  def check(project)
20
27
  gradle = project.android_folder.gradle
21
28
  import_exist = File.readlines("#{gradle.path}/build.gradle").grep(/package android/).size.positive?
@@ -30,18 +37,23 @@ module FlutterRb
30
37
 
31
38
  # Check Flutter plugin version in Gradle project config (build.gradle file)
32
39
  class PluginGradleVersionCheck < Check
40
+ # @return {String}
33
41
  def name
34
42
  'PluginGradleVersionCheck'
35
43
  end
36
44
 
45
+ # @return {String}
37
46
  def summary
38
47
  'Validate Flutter plugin\s version in build.gradle file'
39
48
  end
40
49
 
50
+ # @return {String}
41
51
  def description
42
52
  'Check plugin version in Gradle project config (build.gradle file)'
43
53
  end
44
54
 
55
+ # @param {Project} project
56
+ # @return {CheckReport}
45
57
  def check(project)
46
58
  version_in_pubspec = project.pubspec.pubspec_info.version
47
59
  gradle = project.android_folder.gradle
@@ -1,17 +1,22 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'check'
2
4
  require_relative '../report/check_report'
3
5
 
4
6
  module FlutterRb
5
7
  # Base class for all info parameters in Flutter plugin podspec file
6
8
  class PluginPodspecCheck < Check
9
+ # @return {String}
7
10
  def name
8
11
  "PluginPodspec#{podspec_parameter.capitalize}Check"
9
12
  end
10
13
 
14
+ # @return {String}
11
15
  def podspec_parameter
12
16
  UNIMPLEMENTED_ERROR
13
17
  end
14
18
 
19
+ # @return {String}
15
20
  def summary
16
21
  "Validate Flutter plugin's #{podspec_parameter} in podspec file"
17
22
  end
@@ -19,10 +24,18 @@ module FlutterRb
19
24
 
20
25
  # Check Flutter plugin name in podspec file. Exists or not
21
26
  class PluginPodspecNameCheck < PluginPodspecCheck
27
+ # @return {String}
22
28
  def podspec_parameter
23
29
  'name'
24
30
  end
25
31
 
32
+ # @return {String}
33
+ def description
34
+ 'Check plugin name in podspec file'
35
+ end
36
+
37
+ # @param {Project} project
38
+ # @return {CheckReport}
26
39
  def check(project)
27
40
  name_in_pubspec = project.pubspec.pubspec_info.name
28
41
  podspec = project.ios_folder.podspec
@@ -34,18 +47,22 @@ module FlutterRb
34
47
  podspec.path
35
48
  )
36
49
  end
37
-
38
- def description
39
- 'Check plugin name in podspec file'
40
- end
41
50
  end
42
51
 
43
52
  # Check Flutter plugin version in podspec file. Exists or not
44
53
  class PluginPodspecVersionCheck < PluginPodspecCheck
54
+ # @return {String}
45
55
  def podspec_parameter
46
56
  'version'
47
57
  end
48
58
 
59
+ # @return {String}
60
+ def description
61
+ 'Check plugin version in podspec file'
62
+ end
63
+
64
+ # @param {Project} project
65
+ # @return {CheckReport}
49
66
  def check(project)
50
67
  version_in_pubspec = project.pubspec.pubspec_info.version
51
68
  podspec = project.ios_folder.podspec
@@ -57,18 +74,22 @@ module FlutterRb
57
74
  podspec.path
58
75
  )
59
76
  end
60
-
61
- def description
62
- 'Check plugin version in podspec file'
63
- end
64
77
  end
65
78
 
66
79
  # Check Flutter plugin's authors. Exists or not
67
80
  class PluginPodspecAuthorsCheck < PluginPodspecCheck
81
+ # @return {String}
68
82
  def podspec_parameter
69
83
  'authors'
70
84
  end
71
85
 
86
+ # @return {String}
87
+ def description
88
+ "Check plugin's authors in podspec file"
89
+ end
90
+
91
+ # @param {Project} project
92
+ # @return {CheckReport}
72
93
  def check(project)
73
94
  podspec = project.ios_folder.podspec
74
95
  author_exists = !podspec.authors.nil?
@@ -79,19 +100,23 @@ module FlutterRb
79
100
  podspec.path
80
101
  )
81
102
  end
82
-
83
- def description
84
- "Check plugin's authors in podspec file"
85
- end
86
103
  end
87
104
 
88
105
  # Check plugin iOS source path in podspec file.
89
106
  # If Flutter plugin cannot contains iOS specific code, source path must be '.'
90
107
  class PluginPodspecSourceCheck < PluginPodspecCheck
108
+ # @return {String}
91
109
  def podspec_parameter
92
110
  'source'
93
111
  end
94
112
 
113
+ # @return {String}
114
+ def description
115
+ 'Check plugin iOS source path in podspec file'
116
+ end
117
+
118
+ # @param {Project} project
119
+ # @return {CheckReport}
95
120
  def check(project)
96
121
  podspec = project.ios_folder.podspec
97
122
  CheckReport.new(
@@ -101,9 +126,5 @@ module FlutterRb
101
126
  podspec.path
102
127
  )
103
128
  end
104
-
105
- def description
106
- 'Check plugin iOS source path in podspec file'
107
- end
108
129
  end
109
130
  end
@@ -1,17 +1,22 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'check'
2
4
  require_relative '../report/check_report'
3
5
 
4
6
  module FlutterRb
5
7
  # Base class for all info parameters in Flutter plugin pubspec.yaml file
6
8
  class PluginPubspecCheck < Check
9
+ # @return {String}
7
10
  def name
8
11
  "PluginPubspec#{pubspec_parameter.capitalize}Check"
9
12
  end
10
13
 
14
+ # @return {String}
11
15
  def pubspec_parameter
12
16
  raise UNIMPLEMENTED_ERROR
13
17
  end
14
18
 
19
+ # @return {String}
15
20
  def summary
16
21
  "Validate Flutter plugin's #{pubspec_parameter} in pubspec.yaml"
17
22
  end
@@ -19,10 +24,18 @@ module FlutterRb
19
24
 
20
25
  # Check Flutter plugin name in podspec file. Exists or not
21
26
  class PluginPubspecNameCheck < PluginPubspecCheck
27
+ # @return {String}
22
28
  def pubspec_parameter
23
29
  'name'
24
30
  end
25
31
 
32
+ # @return {String}
33
+ def description
34
+ 'Check plugin name in pubspec file'
35
+ end
36
+
37
+ # @param {Project} project
38
+ # @return {CheckReport}
26
39
  def check(project)
27
40
  pubspec = project.pubspec
28
41
  CheckReport.new(
@@ -32,18 +45,22 @@ module FlutterRb
32
45
  pubspec.path
33
46
  )
34
47
  end
35
-
36
- def description
37
- 'Check plugin name in pubspec file'
38
- end
39
48
  end
40
49
 
41
50
  # Check Flutter plugin description in pubspec file. Exists or not
42
51
  class PluginPubspecDescriptionCheck < PluginPubspecCheck
52
+ # @return {String}
43
53
  def pubspec_parameter
44
54
  'description'
45
55
  end
46
56
 
57
+ # @return {String}
58
+ def description
59
+ 'Check plugin description in pubspec file'
60
+ end
61
+
62
+ # @param {Project} project
63
+ # @return {CheckReport}
47
64
  def check(project)
48
65
  pubspec = project.pubspec
49
66
  CheckReport.new(
@@ -53,18 +70,22 @@ module FlutterRb
53
70
  pubspec.path
54
71
  )
55
72
  end
56
-
57
- def description
58
- 'Check plugin description in pubspec file'
59
- end
60
73
  end
61
74
 
62
75
  # Check Flutter plugin version in pubspec file. Exists or not
63
76
  class PluginPubspecVersionCheck < PluginPubspecCheck
77
+ # @return {String}
64
78
  def pubspec_parameter
65
79
  'version'
66
80
  end
67
81
 
82
+ # @return {String}
83
+ def description
84
+ 'Check plugin version in pubspec'
85
+ end
86
+
87
+ # @param {Project} project
88
+ # @return {CheckReport}
68
89
  def check(project)
69
90
  pubspec = project.pubspec
70
91
  CheckReport.new(
@@ -74,18 +95,22 @@ module FlutterRb
74
95
  pubspec.path
75
96
  )
76
97
  end
77
-
78
- def description
79
- 'Check plugin version in pubspec'
80
- end
81
98
  end
82
99
 
83
100
  # Check Flutter plugin author in pubspec file. Exists or not
84
101
  class PluginPubspecAuthorCheck < PluginPubspecCheck
102
+ # @return {String}
85
103
  def pubspec_parameter
86
104
  'author'
87
105
  end
88
106
 
107
+ # @return {String}
108
+ def description
109
+ 'Check plugin author in pubspec'
110
+ end
111
+
112
+ # @param {Project} project
113
+ # @return {CheckReport}
89
114
  def check(project)
90
115
  pubspec = project.pubspec
91
116
  CheckReport.new(
@@ -95,18 +120,22 @@ module FlutterRb
95
120
  pubspec.path
96
121
  )
97
122
  end
98
-
99
- def description
100
- 'Check plugin author in pubspec'
101
- end
102
123
  end
103
124
 
104
125
  # Check Flutter plugin homepage in pubspec file. Exists or not
105
126
  class PluginPubspecHomepageCheck < PluginPubspecCheck
127
+ # @return {String}
106
128
  def pubspec_parameter
107
129
  'homepage'
108
130
  end
109
131
 
132
+ # @return {String}
133
+ def description
134
+ 'Check plugin homepage in pubspec'
135
+ end
136
+
137
+ # @param {Project} project
138
+ # @return {CheckReport}
110
139
  def check(project)
111
140
  pubspec = project.pubspec
112
141
  CheckReport.new(
@@ -116,37 +145,71 @@ module FlutterRb
116
145
  pubspec.path
117
146
  )
118
147
  end
119
-
120
- def description
121
- 'Check plugin homepage in pubspec'
122
- end
123
148
  end
124
149
 
125
- # Check Flutter plugin Effective Dart depencency in pubspec file. Exists or not
126
- class PluginPubspecEffectiveDartCheck < Check
150
+ # Check Flutter plugin lints dependency in pubspec file. Exists or not
151
+ class PluginPubspecLintsCheck < Check
152
+ # @return {String}
127
153
  def name
128
- 'PluginPubspecEffectiveDartCheck'
154
+ 'PluginPubspecLintsCheck'
129
155
  end
130
156
 
157
+ # @return {String}
131
158
  def summary
132
- 'Validate Flutter plugin\'s Effective Dart rules implementation in pubspec.yaml'
159
+ 'Validate Flutter plugin\'s lints rules implementation in pubspec.yaml'
133
160
  end
134
161
 
162
+ # @return {String}
163
+ def description
164
+ 'Check Flutter plugin lints dependency in pubspec file'
165
+ end
166
+
167
+ # @param {Project} project
168
+ # @return {CheckReport}
135
169
  def check(project)
136
170
  pubspec = project.pubspec
137
- effective_dart = pubspec.dev_dependencies&.detect do |dev_dependency|
138
- dev_dependency.name == 'effective_dart'
171
+ lints = pubspec.dev_dependencies&.detect do |dev_dependency|
172
+ dev_dependency.name == 'lints'
139
173
  end
140
174
  CheckReport.new(
141
175
  name,
142
- effective_dart.nil? ? CheckReportStatus::ERROR : CheckReportStatus::NORMAL,
176
+ lints.nil? ? CheckReportStatus::ERROR : CheckReportStatus::NORMAL,
143
177
  description,
144
178
  pubspec.path
145
179
  )
146
180
  end
181
+ end
182
+
183
+ # Check Flutter plugin flutter_lints dependency in pubspec file. Exists or not
184
+ class PluginPubspecFlutterLintsCheck < Check
185
+ # @return {String}
186
+ def name
187
+ 'PluginPubspecFlutterLintsCheck'
188
+ end
189
+
190
+ # @return {String}
191
+ def summary
192
+ 'Validate Flutter plugin\'s flutter_lints rules implementation in pubspec.yaml'
193
+ end
147
194
 
195
+ # @return {String}
148
196
  def description
149
- 'Check Flutter plugin Effective Dart depencency in pubspec file'
197
+ 'Check Flutter plugin flutter_lints dependency in pubspec file'
198
+ end
199
+
200
+ # @param {Project} project
201
+ # @return {CheckReport}
202
+ def check(project)
203
+ pubspec = project.pubspec
204
+ flutter_lints = pubspec.dev_dependencies&.detect do |dev_dependency|
205
+ dev_dependency.name == 'flutter_lints'
206
+ end
207
+ CheckReport.new(
208
+ name,
209
+ flutter_lints.nil? ? CheckReportStatus::ERROR : CheckReportStatus::NORMAL,
210
+ description,
211
+ pubspec.path
212
+ )
150
213
  end
151
214
  end
152
215
  end