Class: FlutterRb::PluginPubspecLintsCheck
- Defined in:
- lib/flutter_rb/checks/plugin_pubspec_check.rb
Overview
This class represents a check for Flutter plugin’s pubspec.yaml file for ‘lints’ dependency. It inherits from the Check class.
Constant Summary
Constants inherited from Check
Instance Method Summary collapse
-
#check(project) ⇒ CheckReport
Performs the check for the ‘lints’ dependency in the pubspec.yaml file.
-
#description ⇒ String
Returns the description of the check.
-
#name ⇒ String
Returns the name of the check.
Instance Method Details
#check(project) ⇒ CheckReport
Performs the check for the ‘lints’ dependency in the pubspec.yaml file. It creates a CheckReport object with the result of the check.
199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 |
# File 'lib/flutter_rb/checks/plugin_pubspec_check.rb', line 199 def check(project) pubspec = project.pubspec # Detects if 'lints' is a dependency in the pubspec file lints = pubspec.dev_dependencies&.detect do |dev_dependency| dev_dependency.name == 'lints' end # Creates a CheckReport object with the result of the check CheckReport.new( name, lints.nil? ? CheckReportStatus::ERROR : CheckReportStatus::NORMAL, description, pubspec.path ) end |
#description ⇒ String
Returns the description of the check. The description explains what the check is validating.
190 191 192 |
# File 'lib/flutter_rb/checks/plugin_pubspec_check.rb', line 190 def description 'Check Flutter plugin lints dependency in pubspec file' end |
#name ⇒ String
Returns the name of the check.
182 183 184 |
# File 'lib/flutter_rb/checks/plugin_pubspec_check.rb', line 182 def name 'PluginPubspecLintsCheck' end |