Skip to content

Commit 06756f1

Browse files
srawlinsCommit Queue
authored andcommitted
linter: document benchmarking
Change-Id: I274de96698cf7f54295ec78cf409b62a453dae1c Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/391681 Reviewed-by: Brian Wilkerson <[email protected]> Reviewed-by: Phil Quitslund <[email protected]> Commit-Queue: Samuel Rawlins <[email protected]>
1 parent 5e79752 commit 06756f1

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

pkg/linter/CONTRIBUTING.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,39 @@ entry. Notably, any change that:
8282
should have a short entry in the `CHANGELOG`. Feel free to bring up any
8383
questions in your PR.
8484

85+
### Benchmarking
86+
87+
Lint rules can be benchmarked with real code on disk. (There is no
88+
micro-benchmarking suite.) Use the `tool/benchmark.dart` script to execute one
89+
or more lint rules against a corpus of code. Here are some examples:
90+
91+
Execute all of the lint rules enabled by a specified analysis options file
92+
against all of the code in the specified directory.
93+
94+
```none
95+
dart tool/benchmark.dart \
96+
--config $HOME/my/example/analysis_options.yaml \
97+
$HOME/my/example/package
98+
```
99+
100+
Execute all of the lint rules enabled by a specified analysis options file
101+
against all of the code in the specified file.
102+
103+
```none
104+
dart tool/benchmark.dart \
105+
--config $HOME/my/example/analysis_options.yaml \
106+
$HOME/my/example/package/lib/some_file.dart
107+
```
108+
109+
Execute all of a set of specified lint rules against all of the code in the
110+
specified directory.
111+
112+
```none
113+
dart tool/benchmark.dart \
114+
--rules rule_1,rule_2 \
115+
$HOME/my/example/package
116+
```
117+
85118
**Thank you!**
86119

87120
### The small print

0 commit comments

Comments
 (0)