Skip to content
check-circle

GitHub Action

dart-package-inspector

v2.0.4 Latest version

dart-package-inspector

check-circle

dart-package-inspector

Inspect dart/Flutter packages for a certain criteria

Installation

Copy and paste the following snippet into your .yml file.

              

- name: dart-package-inspector

uses: fujidaiti/[email protected]

Learn more about this action in fujidaiti/dart-package-inspector

Choose a version

dart-package-inspector

This action inspects your Dart/Flutter packages for a certain criteria based on the report produced by the pana, a package analyzer that is used on the pub.dev to compute Pub points.

Here's examples of what you can verify with this action:

  • The package earns a total of 140 Pub points.
  • The package earns at least 40 Pub points in the "Pass static analysis" category.
  • The package scores 100% in the "Support up-to-date dependencies" category.
  • The package supports the all platforms.
  • The package is dart3 compatible.

Usage

This action is intended to be used as a post-processor of dart-package-analyzer, a well known GitHub Action that runs pana in the workflows. dart-package-inspector will use the output of this action as one of its inputs.

name: Example workflow
on: [push, pull_request]

jobs:
  package-analysis:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2 # Required for dart-package-analyzer
      
      - uses: axel-op/dart-package-analyzer@v3 # Run pana on your package
        id: analysis # Set an ID to reference the outputs in the next step
        with:
          githubToken: ${{ secrets.GITHUB_TOKEN }}
      
      - uses: fujidaiti/[email protected]
        with:
          report: ${{ steps.analysis.outputs.json_output }} # Required
          min-pub-points: 120

Inputs

  • report - string, Required

    JSON output of pana. Usually obtianed from the dart-package-analyzer's outputs.

    Example:

    report: ${{ steps.analysis.outputs.json_output }}
  • min-pub-points - integer

    The minimum total Pub points required. The default is set to 0.

    Example:

    min-pub-points: 140
  • min-convention-points - integer

    The minimum required Pub points in the "Follow Dart file conventions" category. The default is set to 0.

    Example:

    min-convention-points: 30
  • min-documentation-points - integer

    The minimum required Pub points in the "Provide documentation" category. The default is set to 0.

    Example:

    min-documentation-points: 20
  • min-platform-points - integer

    The minimum required Pub points in the "Platform support" category. The default is set to 0.

    Example:

    min-platform-points: 20
  • min-analysis-points - integer

    The minimum required Pub points in the "Pass static analysis" category. The default is set to 0.

    Example:

    min-analysis-points: 50
  • min-dependency-points - integer

    The minimum required Pub points in the "Support up-to-date dependencies" category. The default is set to 0.

    Example:

    min-dependency-points: 20
  • dart3-compatible - boolean

    Set to true to make sure the package is dart3 compatible, or set to false to disable this check. true by default.

    Example:

    dart3-compatible: true
  • sound-null-safety - boolean

    Set to true to make sure the package supports null safety or set to false to disable this check. true by default.

    Example:

    soud-null-safety: true
  • supported-SDKs - string

    List of SDKs that the package should support. The possible values are dart and flutter. If not specified, the check for the supported SDKs is disabled.

    supported-SDKs: dart, flutter
  • supported-platforms - string

    List of platform names that the package should support. The possible values are ios, android, linux, windows, macos, and web. If not specified, the check for the supported platforms is disabled.

    Example:

    supported-platforms: ios, android

Error messages

If any requirements are not met, error messages are displayed in the Annotations section on the workflow page.

スクリーンショット 2023-08-09 14 57 32

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Support

Please give me a star on GitHub if you like this package. It will motivate me!


Thanks

typescript-action : dart-package-inspector is based on this template repository.