Skip to content

Repository files navigation

Project's logo

flutter_rb

GitHubActionsCodebeatGem VersionGem Downloads

About

CLI tool for checking a Flutter plugin structure.

Checks

Levels

Each issue has a level parameter that describes its significant importance.

LevelDescription
NORMALIssue not found
WARNINGIssue is not serious and can't break a build
ERRORIssue is critical and can break a build

Flutter

CheckDescriptionLevel
PluginDirectoriesCheckCheck 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 failsERROR
PluginPubspecNameCheckCheck plugin name in pubspec file. Exists or notERROR
PluginPubspecDescriptionCheckCheck plugin description in pubspec file. Exists or notWARNING
PluginPubspecVersionCheckCheck plugin version in pubspec. Exists or notERROR
PluginPubspecAuthorCheckCheck plugin author in pubspec. Exists or not. author section deprecated in pubspec.yamlWARNING
PluginPubspecHomepageCheckCheck plugin homepage in pubspec. Exists or notERROR
PluginPubspecLintsCheckCheck Flutter plugin lints dependency in pubspec file. Exists or notERROR
PluginPubspecFlutterLintsCheckCheck Flutter plugin flutter_lints dependency in pubspec file. Exists or notERROR

Android

CheckDescriptionLevel
PluginGradleAndroidPackageCheckValidate that \android\ package not exists in Gradle project config (build.gradle file)ERROR
PluginGradleVersionCheckCheck plugin version in Gradle project config (build.gradle file). Version must be the same as plugin version in pubspec fileWARNING

iOS

CheckDescriptionLevel
PluginPodspecNameCheckCheck plugin name in podspec file. Exists or notWARNING
PluginPodspecVersionCheckCheck plugin version in podspec file. Exists or notWARNING
PluginPodspecAuthorsCheckCheck plugin's authors in podspec file. Exists or notERROR
PluginPodspecSourceCheckCheck plugin iOS source path in podspec file. If Flutter plugin cannot contains iOS specific code, source path must be '.'ERROR

How to use

Android

You should add flutter-rb-gradle-plugin to Android side of your plugin.

Download gem from RubyGems

$ gem i flutter_rb

Then run from a Flutter plugin's project folder:

$ frb

As local installed gem

Build and install gem from sources:

$ gem build flutter_rb.gemspec
$ gem i flutter_rb

Then run from a Flutter plugin's project folder:

$ frb inspect --path=./project_folder

As local executable

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:

$ local_frb inspect --path=./project_folder

Commands

Inspect

Starts the flutter-rb.

$ frb inspect --path=./project_folder --report
ArgumentDescription
--pathPath to Dart/Flutter project. flutter-rb will be use current directory if this parameter are empty
--reportGenerate report in Checkstyle format

Version

Puts using version of flutter-rb.

$ frb version

Author

Puts author and our contacts.

$ frb author

Configuration

CLI

Since version 1.2.2 you can generate config by following command in terminal:

$ frb config

Manually

Add .flutter_rb.yaml to root of a project for select checks that you are want to exclude:

exclude:
flutter:
- PluginDirectoriesCheck
- PluginPubspecNameCheck
- PluginPubspecDescriptionCheckandroid:
- PluginGradleAndroidPackageCheckios:
- PluginPodspecNameCheck
- PluginPodspecVersionCheck
- PluginPodspecAuthorsCheck

Output report

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.

How to contribute

Documentation

Just run:

$ rdoc

Contribution

Read Commit Convention. Make sure your build is green before you contribute your pull request. Then:

$ bundle exec rake

If you don't see any error messages, submit your pull request.

Contributors

Releases

Contributors

Languages