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/dart-package-inspector@v1.0.0
with:
report: ${{ steps.analysis.outputs.json_output }} # Required
min-pub-points: 120
Inputs
-
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
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](https://private-user-images.githubusercontent.com/68946713/259311371-ba95ca29-637d-440e-886f-89a75cbb9103.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTEiLCJleHAiOjE3MDI3OTA2NjQsIm5iZiI6MTcwMjc5MDM2NCwicGF0aCI6Ii82ODk0NjcxMy8yNTkzMTEzNzEtYmE5NWNhMjktNjM3ZC00NDBlLTg4NmYtODlhNzVjYmI5MTAzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFJV05KWUFYNENTVkVINTNBJTJGMjAyMzEyMTclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjMxMjE3VDA1MTkyNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTE3ODg2MTgwZjAzNTQ5ZTljNDRjOTI0MDQ0NjYyZDdjYzI5YjM3ZGUzY2I4Y2FkZTliNWFmZmVhYTlhMDcxNmMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.eJK3wPxevCdPRSq0-D5NcItyl68x-f5WkeLsC8GBMTc)
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!
- 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
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.