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

Commit 4f1d912

Browse files
committed
docs: add check-unnecessary-nullable to readme
1 parent 4152cd7 commit 4f1d912

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ Dart Code Metrics is a static analysis tool that helps you analyse and improve y
3636
- Checks for [anti-patterns](https://dartcodemetrics.dev/docs/anti-patterns/overview)
3737
- Checks [unused `*.dart` files](https://dartcodemetrics.dev/docs/cli/check-unused-files)
3838
- Checks [unused l10n](https://dartcodemetrics.dev/docs/cli/check-unused-l10n)
39+
- Checks [unnecessary nullable parameters](https://dartcodemetrics.dev/docs/cli/check-unnecessary-nullable)
3940
- Can be used as [CLI](https://dartcodemetrics.dev/docs/cli/overview), [analyzer plugin](https://dartcodemetrics.dev/docs/analyzer-plugin) or [library](https://dartcodemetrics.dev/docs/getting-started/installation#library)
4041

4142
## Links
@@ -119,6 +120,7 @@ The package can be used as CLI and supports multiple commands:
119120
| Command | Example of use | Short description |
120121
| ------------------ | --------------------------------------------------------- | --------------------------------------------------------- |
121122
| analyze | dart run dart_code_metrics:metrics analyze lib | Reports code metrics, rules and anti-patterns violations. |
123+
| check-unnecessary-nullable | dart run dart_code_metrics:metrics check-unnecessary-nullable lib | Checks unnecessary nullable parameters in functions, methods, constructors. |
122124
| check-unused-files | dart run dart_code_metrics:metrics check-unused-files lib | Checks unused \*.dart files. |
123125
| check-unused-l10n | dart run dart_code_metrics:metrics check-unused-l10n lib | Check unused localization in \*.dart files. |
124126
| check-unused-code | dart run dart_code_metrics:metrics check-unused-code lib | Checks unused code in \*.dart files. |
@@ -150,6 +152,26 @@ Console report example:
150152

151153
![Console report example](https://raw.githubusercontent.com/dart-code-checker/dart-code-metrics/master/assets/analyze-console-report.png)
152154

155+
#### Check unnecessary nullable parameters
156+
157+
Checks unnecessary nullable parameters in functions, methods, constructors. To execute the command, run
158+
159+
```sh
160+
$ dart run dart_code_metrics:metrics check-unnecessary-nullable lib
161+
162+
# or for a Flutter package
163+
$ flutter pub run dart_code_metrics:metrics check-unnecessary-nullable lib
164+
```
165+
166+
It will produce a result in one of the format:
167+
168+
- Console
169+
- JSON
170+
171+
Console report example:
172+
173+
![Console report example](https://raw.githubusercontent.com/dart-code-checker/dart-code-metrics/master/assets/unused-files-console-report.png)
174+
153175
#### Check unused files
154176

155177
Checks unused `*.dart` files. To execute the command, run
220 KB
Loading

website/docs/cli/check-unnecessary-nullable.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Check unnecessary nullable parameters
22

3-
Check unnecessary nullable parameters in functions, methods, constructors. Removing unnecessary nullables can help reduce amount of checks in the code.
3+
Checks unnecessary nullable parameters in functions, methods, constructors. Removing unnecessary nullables can help reduce amount of checks in the code.
44

55
To execute the command, run
66

0 commit comments

Comments
 (0)