Skip to content
This repository was archived by the owner on Jul 16, 2023. It is now read-only.

Commit 267cc4f

Browse files
feat: export cli runner and add documentation for use-case (#1040)
* chore: bump dorny/test-reporter from 1.5.0 to 1.6.0 (#1037) Bumps [dorny/test-reporter](https://github.com/dorny/test-reporter) from 1.5.0 to 1.6.0. - [Release notes](https://github.com/dorny/test-reporter/releases) - [Changelog](https://github.com/dorny/test-reporter/blob/main/CHANGELOG.md) - [Commits](dorny/test-reporter@v1.5.0...v1.6.0) --- updated-dependencies: - dependency-name: dorny/test-reporter dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * feat: export cli runner and add documentation for use-case Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent 0aec13e commit 267cc4f

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## Unreleased
44

5+
* feat: make CliRunner a part of public API in order to support transitive executable calls use-case.
56
* feat: add static code diagnostic [`avoid-cascade-after-if-null`](https://dartcodemetrics.dev/docs/rules/common/avoid-cascade-after-if-null).
67

78
## 4.21.2

lib/cli_runner.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export 'package:dart_code_metrics/src/cli/cli_runner.dart';

website/docs/cli/index.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,17 @@ metrics:
6060
Run `dart_code_metrics` in all packages.
6161
- Note: you can also rely on your IDEs Dart Analysis / Issues window.
6262
```
63+
64+
## Calling the cli from your own package with the linter configuration
65+
66+
If you have a separate package with all the linter and DCM configurations which is used by your other packages and you want to call DCM transitively add a `bin` folder with a Dart file, for example
67+
68+
```dart metrics.dart
69+
import 'package:dart_code_metrics/cli_runner.dart';
70+
71+
Future<void> main(List<String> args) async {
72+
await CliRunner().run(args);
73+
}
74+
```
75+
76+
After that you will be able to run DCM by calling your package executable.

0 commit comments

Comments
 (0)