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.
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/dart-package-inspector@v1.0.0
with:
report: ${{ steps.analysis.outputs.json_output }} # Required
min-pub-points: 120
-
report
- string, RequiredJSON output of pana. Usually obtianed from the dart-package-analyzer's outputs.
Example:
report: ${{ steps.analysis.outputs.json_output }}
-
min-pub-points
- integerThe minimum total Pub points required. The default is set to 0.
Example:
min-pub-points: 140
-
min-convention-points
- integerThe 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
- integerThe minimum required Pub points in the "Provide documentation" category. The default is set to 0.
Example:
min-documentation-points: 20
-
min-platform-points
- integerThe minimum required Pub points in the "Platform support" category. The default is set to 0.
Example:
min-platform-points: 20
-
min-analysis-points
- integerThe minimum required Pub points in the "Pass static analysis" category. The default is set to 0.
Example:
min-analysis-points: 50
-
min-dependency-points
- integerThe 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
- booleanSet to
true
to make sure the package is dart3 compatible, or set tofalse
to disable this check.true
by default.Example:
dart3-compatible: true
-
sound-null-safety
- booleanSet to
true
to make sure the package supports null safety or set tofalse
to disable this check.true
by default.Example:
soud-null-safety: true
-
supported-SDKs
- stringList of SDKs that the package should support. The possible values are
dart
andflutter
. If not specified, the check for the supported SDKs is disabled.supported-SDKs: dart, flutter
-
supported-platforms
- stringList of platform names that the package should support. The possible values are
ios
,android
,linux
,windows
,macos
, andweb
. If not specified, the check for the supported platforms is disabled.Example:
supported-platforms: ios, android
If any requirements are not met, error messages are displayed in the Annotations section on the workflow page.
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!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Please give me a star on GitHub if you like this package. It will motivate me!
typescript-action : dart-package-inspector is based on this template repository.