All Projects → axel-op → dart-package-analyzer

axel-op / dart-package-analyzer

Licence: MIT License
GitHub Action that uses the Dart Package Analyzer to compute the Pub score of Dart/Flutter packages

Programming Languages

dart
5743 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to dart-package-analyzer

open route service
An encapsulation made around openrouteservice API for Dart and Flutter projects. Made for easy generation of Routes and Directions on Maps, Isochrones, Time-Distance Matrix, Pelias Geocoding, POIs, Elevation and routing Optimizations using their amazing API.
Stars: ✭ 20 (-54.55%)
Mutual labels:  flutter-package, dart-package
dartexif
Dart package to decode Exif data from tiff, jpeg and heic files
Stars: ✭ 16 (-63.64%)
Mutual labels:  flutter-package, dart-package
Flarts
Flutter Charts
Stars: ✭ 61 (+38.64%)
Mutual labels:  flutter-package, dart-package
flutter sliding tutorial
User onboarding library with smooth animation of objects and background colors
Stars: ✭ 127 (+188.64%)
Mutual labels:  flutter-package, dart-package
credit card validator
A Dart package that validates credit card numbers, expiration dates, and security codes (CVV/CVC) based on the type of credit card
Stars: ✭ 19 (-56.82%)
Mutual labels:  flutter-package, dart-package
Motion-Tab-Bar
A beautiful animated flutter widget package library. The tab bar will attempt to use your current theme out of the box, however you may want to theme it.
Stars: ✭ 237 (+438.64%)
Mutual labels:  flutter-package, dart-package
Flogs
An Advanced Logging Framework develop in flutter that provides quick & simple logging solution.
Stars: ✭ 158 (+259.09%)
Mutual labels:  flutter-package, dart-package
prathimacode-hub
Hello everyone, Welcome to my GitHub README profile. Glad to see you here! Check out this repository to view my work and learn more about me. Don't just star it, fork it as well.📢✌️
Stars: ✭ 53 (+20.45%)
Mutual labels:  github-actions
setup-swift
GitHub Action that setup a Swift environment
Stars: ✭ 114 (+159.09%)
Mutual labels:  github-actions
aur-publish-docker-action
Github Action to publish an AUR package
Stars: ✭ 13 (-70.45%)
Mutual labels:  github-actions
custom timer
A Flutter package to create a customizable timer.
Stars: ✭ 25 (-43.18%)
Mutual labels:  flutter-package
overview
Automate your workflows with GitHub actions for MATLAB.
Stars: ✭ 40 (-9.09%)
Mutual labels:  github-actions
gajira
GitHub Actions for Jira
Stars: ✭ 100 (+127.27%)
Mutual labels:  github-actions
SpaceSeek
See and search upcoming and previous rocket space launches! Built with React Native, using Detox E2E tests, Fastlane and Github Actions for app store deployment.
Stars: ✭ 19 (-56.82%)
Mutual labels:  github-actions
deploy-to-cocoapods-github-action
Github action for deploying to Cocoapods.org
Stars: ✭ 29 (-34.09%)
Mutual labels:  github-actions
misspell-fixer-action
📝Automatically fixes typos and mistakes in your source code and docs!
Stars: ✭ 123 (+179.55%)
Mutual labels:  github-actions
addtobasic.github.io
CUI Portfolio like ubuntu terminal.
Stars: ✭ 18 (-59.09%)
Mutual labels:  github-actions
git-actions
A GitHub Action to run arbitrary git commands
Stars: ✭ 72 (+63.64%)
Mutual labels:  github-actions
vsce-action
A GitHub Action to automate deploying VS Code extensions
Stars: ✭ 74 (+68.18%)
Mutual labels:  github-actions
yamllint-action
Lints yaml files and annotates every finding.
Stars: ✭ 12 (-72.73%)
Mutual labels:  github-actions

Dart/Flutter package analyzer

This action uses the pana (Package ANAlysis) package to compute the score that your Dart or Flutter package will have on the Pub site.

This package, amongst other things:

  • validates the code by performing static analysis with dartanalyzer,
  • checks code formatting with dartfmt or flutter format (detected automatically),
  • checks for outdated dependencies,
  • validates the pubspec.yaml file (dependencies, description's length...),
  • checks for required files (CHANGELOG, README, example folder...)
  • ...

The pana package gives scores in five categories and sum them up to get your total score.

Usage

You must include the actions/checkout step in your workflow. You don't need to run pub get or build a Dart container before.

This action uses its own Dart container. I recommend you to run it in a separate job, as jobs run in parallel.

Inputs

  • githubToken
    Required to post a report on GitHub. Note: the secret GITHUB_TOKEN is already provided by GitHub and you don't have to set it up yourself.
  • relativePath
    If your package isn't at the root of the repository, set this input to indicate its location.

Example:

name: Example workflow
on: [push, pull_request]

jobs:

  package-analysis:

    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2 # required

      - uses: axel-op/dart-package-analyzer@v3
        with:
          # Required:
          githubToken: ${{ secrets.GITHUB_TOKEN }}
          # Optional:
          relativePath: packages/mypackage/

Outputs

There is an output for each of the six categories that are evaluated by the pana package, whose value is the score obtained by your package, plus an output for the total score of your package.

For each of these outputs, there is also a ..._max output corresponding to the maximum score that a package can have in the category.

There is also an output containing the full pana output in JSON format if you need to parse it yourself.

You can use the outputs in the next steps of your workfow by associating an id to this action. In the following steps, you can retrieve an output with ${{ steps.the_id.outputs.name_of_output }} (see the example below).

  • total & total_max
    The total score of your package, and the maximum score that it can get.

  • conventions & conventions_max
    Score for the category Follow Dart file conventions.

  • documentation & documentation_max
    Score for the category Provide documentation.

  • platforms & platforms_max
    Score for the category Support multiple platforms.

  • analysis & analysis_max
    Score for the category Pass static analysis.

  • dependencies & dependencies_max
    Score for the category Support up-to-date dependencies.

  • null_safety & null_safety_max
    Score for the category Support null-safety.

  • json_output The pana output in JSON format.

Usage example

name: Example workflow
on: [push, pull_request]

jobs:

  package-analysis:

    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2

      - uses: axel-op/dart-package-analyzer@v3
        # set an id for the current step
        id: analysis
        with:
          githubToken: ${{ secrets.GITHUB_TOKEN }}

      # You can then use this id to retrieve the outputs in the next steps.
      # The following step shows how to exit the workflow with an error if the total score in percentage is below 50:
      - name: Check scores
        env:
          # NB: "analysis" is the id set above. Replace it with the one you used if different.
          TOTAL: ${{ steps.analysis.outputs.total }}
          TOTAL_MAX: ${{ steps.analysis.outputs.total_max }}
        run: |
          PERCENTAGE=$(( $TOTAL * 100 / $TOTAL_MAX ))
          if (( $PERCENTAGE < 50 ))
          then
            echo Score too low!
            exit 1
          fi

Example

Example report

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].