matchable_builder 0.4.2+2

  • Readme
  • Changelog
  • Installing
  • 44

Matchable Builder #

Matchable builder provides a easier way to find files that you want generate code from.

Usage #

Builder demoBuilder(BuilderOptions ops) => DemoBuilder();

class DemoBuilder extends MatchableBuilder {
  @override
  Matcher get buildStepMatcher => Matcher.and([
        FilenameExtensionMatcher('.dart'),
      ]);

  @override
  Matcher get elementMatcher => Matcher.and([
        ElementTypeMatcher<ClassElement>(),
        ElementAnnotationMatcher<Deprecated>(),
        ElementNamePrefixMatcher('a'),
      ]);

  @override
  Map<String, List<String>> get buildExtensions => {
        '.dart': ['.demo.dart'],
      };

  @override
  FutureOr<void> generate(List<Element> elements, BuildStep buildStep) {
    print('${buildStep.inputId.path} | ${elements}');
    return null;
  }
}

0.4.2+2 #

  • Increase capability

0.4.2+1 #

  • Disable formatter

0.4.2 #

  • Automatically format cache output

0.4.1 #

  • Redesign MatchableCombiningBuilder

0.4.0 #

  • Added MatchableCombiningBuilder
  • Extract MatchableBaseBuilder

0.3.1 #

  • Extra exports

0.3.0 #

  • Add more matchers

0.2.0 #

  • Redo Matcher
  • Add more matchers

0.1.0 #

  • Initial version
  • Basic usage are completed

Use this package as a library

1. Depend on it

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


dependencies:
  matchable_builder: ^0.4.2+2

2. Install it

You can install packages from the command line:

with pub:


$ pub get

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

3. Import it

Now in your Dart code, you can use:


import 'package:matchable_builder/matchable_builder.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
95
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
80
Overall:
Weighted score of the above. [more]
44
Learn more about scoring.

We analyzed this package on Apr 6, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.6

Health issues and suggestions

Document public APIs. (-1 points)

159 out of 159 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Fix lib/src/matcher/class_element_assignable_from_matcher.dart. (-0.50 points)

Analysis of lib/src/matcher/class_element_assignable_from_matcher.dart reported 1 hint:

line 2 col 8: Unused import: 'package:analyzer/dart/element/type.dart'.

Fix lib/src/matcher/class_element_direct_super_type_matcher.dart. (-0.50 points)

Analysis of lib/src/matcher/class_element_direct_super_type_matcher.dart reported 1 hint:

line 2 col 8: Unused import: 'package:analyzer/dart/element/type.dart'.

Fix lib/src/matcher/class_element_interface_matcher.dart. (-0.50 points)

Analysis of lib/src/matcher/class_element_interface_matcher.dart reported 1 hint:

line 2 col 8: Unused import: 'package:analyzer/dart/element/type.dart'.

Fix additional 10 files with analysis or formatting issues. (-3 points)

Additional issues in the following files:

  • lib/src/matcher/element_annotation_matcher.dart (1 hint)
  • lib/src/matcher/element_name_matcher.dart (1 hint)
  • lib/src/matcher/element_type_matcher.dart (1 hint)
  • lib/src/matcher/filename_matcher.dart (1 hint)
  • lib/src/matcher/functional_matcher.dart (1 hint)
  • lib/src/support/matchable_combining_builder.dart (1 hint)
  • lib/src/matcher/class_element_constructor_annotation_matcher.dart (Run dartfmt to format lib/src/matcher/class_element_constructor_annotation_matcher.dart.)
  • lib/src/matcher/class_element_constructor_matcher.dart (Run dartfmt to format lib/src/matcher/class_element_constructor_matcher.dart.)
  • lib/src/matcher/filename_exact_extension_matcher.dart (Run dartfmt to format lib/src/matcher/filename_exact_extension_matcher.dart.)
  • lib/src/matcher/filename_extension_matcher.dart (Run dartfmt to format lib/src/matcher/filename_extension_matcher.dart.)

Maintenance issues and suggestions

Use constrained dependencies. (-20 points)

The pubspec.yaml contains 1 dependency without version constraints. Specify version ranges for the following dependencies: analyzer.

Maintain an example.

None of the files in the package's example/ directory matches known example patterns.

Common filename patterns include main.dart, example.dart, and matchable_builder.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.4.0 <3.0.0
analyzer >=0.36.0 0.39.5
build ^1.2.2 1.2.2
glob ^1.2.0 1.2.0
meta ^1.1.8 1.1.8
source_gen ^0.9.4+6 0.9.5
Transitive dependencies
_fe_analyzer_shared 2.0.0
args 1.6.0
async 2.4.1
charcode 1.1.3
collection 1.14.12
convert 2.1.1
crypto 2.1.4
csslib 0.16.1
dart_style 1.3.4
html 0.14.0+3
js 0.6.1+1
logging 0.11.4
node_interop 1.0.3
node_io 1.0.1+2
package_config 1.9.3
path 1.6.4
pub_semver 1.4.4
source_span 1.7.0
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
watcher 0.9.7+14
yaml 2.2.0
Dev dependencies
pedantic ^1.7.0 1.9.0
test ^1.6.0