Skip to content
pubscout

sort_pubspec_dependencies

0.0.2, released a year ago by an unverified publisher

A Dart CLI tool for sorting dependencies and dev_dependencies in pubspec.yaml alphabetically.

$ flutter pub add sort_pubspec_dependencies
Source repository

What it does

Sorts dependencies, dev_dependencies, and dependency_overrides in pubspec.yaml alphabetically while preserving comments and metadata. Can be run via CLI or configured with a yaml file.

AI-written summary of version 0.0.2, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You want to keep your pubspec.yaml dependencies organized and sorted consistently.
  • You want to automate pubspec sorting in your development workflow.

Skip it when

  • You require custom dependency ordering that is not alphabetical.

Strengths

  • Maintains additional metadata like paths, Git URLs, and version constraints.
  • Preserves comments before dependencies.
  • Zero transitive dependencies and lightweight.

Weaknesses

  • Limited configuration options outside of path and running pub get.

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
0

Add as a dev dependency in your pubspec.yaml and run via dart run sort_pubspec_dependencies.

dart run sort_pubspec_dependencies

Alternatives

Packages that do the same job and could replace sort_pubspec_dependencies.

  • cider

    CLI tool for Dart package maintenance to automate pubspec.yaml and CHANGELOG.md updates.

  • rps

    Run and manage scripts defined in pubspec.yaml or rps.yaml from the command line