Class: FlutterRb::PluginPubspecFlutterLintsCheck
- Defined in:
- lib/flutter_rb/checks/plugin_pubspec_check.rb
Overview
This class represents a check for Flutter plugin’s pubspec.yaml file for ‘flutter_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 ‘flutter_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 ‘flutter_lints’ dependency in the pubspec.yaml file. It creates a CheckReport object with the result of the check.
239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 |
# File 'lib/flutter_rb/checks/plugin_pubspec_check.rb', line 239 def check(project) pubspec = project.pubspec # Detects if 'flutter_lints' is a dependency in the pubspec file flutter_lints = pubspec.dev_dependencies&.detect do |dev_dependency| dev_dependency.name == 'flutter_lints' end # Creates a CheckReport object with the result of the check CheckReport.new( name, flutter_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.
230 231 232 |
# File 'lib/flutter_rb/checks/plugin_pubspec_check.rb', line 230 def description 'Check Flutter plugin flutter_lints dependency in pubspec file' end |
#name ⇒ String
Returns the name of the check.
222 223 224 |
# File 'lib/flutter_rb/checks/plugin_pubspec_check.rb', line 222 def name 'PluginPubspecFlutterLintsCheck' end |