dependency_validator 1.2.3

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 69

Dependency Validator

A tool to help you find missing, under-promoted, over-promoted, and unused dependencies.

Getting Started

Install dependency_validator

Add the following to your pubspec.yaml:

dev_dependencies:
  dependency_validator: ^1.0.0

Usage

This package comes with a single executable: dependency_validator. To run this executable: pub run dependency_validator. This usage will run the tool and report any missing, under-promoted, over-promoted, and unused dependencies.

  • Missing: When a dependency is used in the package but not declared in the pubspec.yaml
    • Optionaly do not fail by using the --no-fatal-missing flag.
  • Under-promoted: When a dependency is used within lib/ but only declared as a dev_dependency.
    • Optionaly do not fail by using the --no-fatal-under-promoted flag.
  • Over-promoted: When a dependency is only used outside lib/ but declared as a dependency.
    • Optionaly do not fail by using the --no-fatal-over-promoted flag.
  • Unused: When a dependency is not used in the package but declared in the pubspec.yaml.
    • Optionaly do not fail by using the --no-fatal-unused flag.
    • Some packages are not imported by any dart files but are used for their executables. If that is the case they can be white-listed by using the --ignore option.
    dependency_validator --ignore coverage,dartdoc
    

1.2.2

  • Bug Fix: Ignoring a package via --ignore or -i will now also work as expected for the "pinned dependency" failure. #39

1.2.1

  • Dart 2 compatible. #35

1.2.0

  • Feature: Pinning a dependency (i.e. preventing patch or minor versions from being consumed) now causes validator to fail. You can opt-out of this feature with --no-fatal-pins. #27

  • Feature: Added a --help flag that outputs usage information. #28

  • Improvement: Package imports in .scss files are now detected. #26

1.1.2

  • Initial Dart 2/DDC compatibility changes. #23

1.1.1

  • Bug Fix: Fix detection of packages whose names contain numbers. #17

1.1.0

  • Feature: Added flags to control the types of validations that this tool enforces. They all default to true, but can be opted out of like so:

    • --no-fatal-missing

    • --no-fatal-under-promoted

    • --no-fatal-over-promoted

    • --no-fatal-unused

      #14

  • Feature: Added --exclude-dir to allow excluding an entire directory from the dependency validator checks. #15

1.0.1

  • Bug Fix: Packages ignored via the --ignore option will no longer be reported at all (previously they were only being ignored in the "unused" list). #10 #12

1.0.0

  • Initial version!

Use this package as an executable

1. Install it

You can install the package from the command line:


$ pub global activate dependency_validator

2. Use it

The package has the following executables:


$ dependency_validator

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  dependency_validator: ^1.2.3

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:dependency_validator/dependency_validator.dart';
  
Version Uploaded Documentation Archive
1.2.3 Sep 20, 2018 Go to the documentation of dependency_validator 1.2.3 Download dependency_validator 1.2.3 archive
1.2.2 Aug 2, 2018 Go to the documentation of dependency_validator 1.2.2 Download dependency_validator 1.2.2 archive
1.2.1 Jul 31, 2018 Go to the documentation of dependency_validator 1.2.1 Download dependency_validator 1.2.1 archive
1.1.2 Apr 9, 2018 Go to the documentation of dependency_validator 1.1.2 Download dependency_validator 1.1.2 archive
1.1.1 Feb 28, 2018 Go to the documentation of dependency_validator 1.1.1 Download dependency_validator 1.1.1 archive
1.1.0 Feb 27, 2018 Go to the documentation of dependency_validator 1.1.0 Download dependency_validator 1.1.0 archive
1.0.1 Feb 9, 2018 Go to the documentation of dependency_validator 1.0.1 Download dependency_validator 1.0.1 archive
1.0.0 Nov 17, 2017 Go to the documentation of dependency_validator 1.0.0 Download dependency_validator 1.0.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
43
Health:
Code health derived from static analysis. [more]
98
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
69
Learn more about scoring.

We analyzed this package on Dec 5, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.1.0
  • pana: 0.12.7

Platforms

Detected platforms: Flutter, other

Primary library: package:dependency_validator/dependency_validator.dart with components: io.

Health suggestions

Fix bin/dependency_validator.dart. (-1.99 points)

Analysis of bin/dependency_validator.dart reported 4 hints:

line 52 col 5: 'allowMultiple' is deprecated and shouldn't be used.

line 54 col 5: 'splitCommas' is deprecated and shouldn't be used.

line 59 col 5: 'allowMultiple' is deprecated and shouldn't be used.

line 61 col 5: 'splitCommas' is deprecated and shouldn't be used.

Format lib/dependency_validator.dart.

Run dartfmt to format lib/dependency_validator.dart.

Format lib/src/constants.dart.

Run dartfmt to format lib/src/constants.dart.

Format lib/src/utils.dart.

Run dartfmt to format lib/src/utils.dart.

Maintenance suggestions

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use dependency_validator.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.24.2 <3.0.0
args >=0.13.7 <2.0.0 1.5.1
logging ^0.11.3+1 0.11.3+2
path ^1.4.2 1.6.2
pub_semver ^1.4.1 1.4.2
yaml ^2.1.13 2.1.15
Transitive dependencies
charcode 1.1.2
collection 1.14.11
meta 1.1.6
source_span 1.4.1
string_scanner 1.0.4
Dev dependencies
build_runner >=0.6.0 <1.0.0
build_test >=0.9.0 <1.0.0
coverage >=0.9.3 <0.13.0
dart_style ^1.0.8
test >=0.12.30 <2.0.0