Skip to content
This repository was archived by the owner on Nov 5, 2022. It is now read-only.

Commit 59e9d4a

Browse files
authored
Merge pull request #22 from davidmorgan/split-yamls
Split into versioned yaml files; update README.md.
2 parents 96ca50c + 96cf3ec commit 59e9d4a

12 files changed

+244
-38
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 1.7.0
2+
3+
- Add versioned `analysis_options.yaml` files to the package so it's possible
4+
to pin to a version without also pinning the pub dependency. See `README.md`
5+
for updated usage guide.
6+
17
## 1.6.0
28

39
- Enforce six new lint rules:

README.md

+19-10
Original file line numberDiff line numberDiff line change
@@ -33,30 +33,39 @@ Here is how static analysis is used internally at Google:
3333

3434
## Enabled Lints
3535

36-
The currently enabled lints can be found in the sample
37-
[analysis_options.yaml](https://github.com/dart-lang/pedantic/blob/master/lib/analysis_options.yaml).
36+
The currently enabled lints can be found in
37+
[analysis_options.1.7.0.yaml](https://github.com/dart-lang/pedantic/blob/master/lib/analysis_options.1.7.0.yaml).
3838

39-
To use those lints you can add a dependency in your `pubspec.yaml`:
39+
## Using the Lints
40+
41+
To use the lints add a dependency in your `pubspec.yaml`:
4042

4143
```yaml
42-
# If you also need to import `package:pedantic/pedantic.dart`, it's a
43-
# normal dependency.
44+
# If you use `package:pedantic/pedantic.dart`, add a normal dependency.
4445
dependencies:
45-
pedantic: '1.4.0'
46+
pedantic: '1.7.0'
4647

4748
# Or, if you just want `analysis_options.yaml`, it can be a dev dependency.
4849
dev_dependencies:
49-
pedantic: '1.4.0'
50+
pedantic: '1.7.0'
5051
```
5152
52-
and add an include in your `analysis_options.yaml`:
53+
then, add an include in your `analysis_options.yaml`. If you want to always
54+
use the latest version of the lints, add a dependency on the main
55+
`analysis_options` file:
56+
5357

5458
```yaml
5559
include: package:pedantic/analysis_options.yaml
5660
```
5761

58-
This example uses a pinned version because every added lint rule could break a
59-
build for projects using it.
62+
If your continuous build and/or presubmit check lints then they will likely
63+
fail whenever a new version of `package:pedantic` is released. To avoid this,
64+
specify a specific version of `analysis_options.yaml` instead:
65+
66+
```yaml
67+
include: package:pedantic/analysis_options.1.7.0.yaml
68+
```
6069

6170
## Unused Lints
6271

lib/analysis_options.1.0.0.yaml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
2+
# for details. All rights reserved. Use of this source code is governed by a
3+
# BSD-style license that can be found in the LICENSE file.
4+
#
5+
# Google internally enforced rules. See README.md for more information,
6+
# including a list of lints that are intentionally _not_ enforced.
7+
8+
linter:
9+
rules:
10+
- avoid_empty_else
11+
- avoid_relative_lib_imports
12+
- avoid_return_types_on_setters
13+
- avoid_types_as_parameter_names
14+
- control_flow_in_finally
15+
- no_duplicate_case_values
16+
- prefer_contains
17+
- prefer_equal_for_default_values
18+
- prefer_is_not_empty
19+
- recursive_getters
20+
- throw_in_finally
21+
- unrelated_type_equality_checks
22+
- use_rethrow_when_possible
23+
- valid_regexps

lib/analysis_options.1.1.0.yaml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
2+
# for details. All rights reserved. Use of this source code is governed by a
3+
# BSD-style license that can be found in the LICENSE file.
4+
#
5+
# Google internally enforced rules. See README.md for more information,
6+
# including a list of lints that are intentionally _not_ enforced.
7+
8+
linter:
9+
rules:
10+
- avoid_empty_else
11+
- avoid_relative_lib_imports
12+
- avoid_return_types_on_setters
13+
- avoid_types_as_parameter_names
14+
- control_flow_in_finally
15+
- no_duplicate_case_values
16+
- prefer_contains
17+
- prefer_equal_for_default_values
18+
- prefer_is_not_empty
19+
- recursive_getters
20+
- throw_in_finally
21+
- unrelated_type_equality_checks
22+
- use_rethrow_when_possible
23+
- valid_regexps

lib/analysis_options.1.2.0.yaml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
2+
# for details. All rights reserved. Use of this source code is governed by a
3+
# BSD-style license that can be found in the LICENSE file.
4+
#
5+
# Google internally enforced rules. See README.md for more information,
6+
# including a list of lints that are intentionally _not_ enforced.
7+
8+
linter:
9+
rules:
10+
- avoid_empty_else
11+
- avoid_relative_lib_imports
12+
- avoid_return_types_on_setters
13+
- avoid_types_as_parameter_names
14+
- no_duplicate_case_values
15+
- prefer_contains
16+
- prefer_equal_for_default_values
17+
- prefer_is_not_empty
18+
- recursive_getters
19+
- unrelated_type_equality_checks
20+
- use_rethrow_when_possible
21+
- unawaited_futures
22+
- valid_regexps

lib/analysis_options.1.3.0.yaml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
2+
# for details. All rights reserved. Use of this source code is governed by a
3+
# BSD-style license that can be found in the LICENSE file.
4+
#
5+
# Google internally enforced rules. See README.md for more information,
6+
# including a list of lints that are intentionally _not_ enforced.
7+
8+
linter:
9+
rules:
10+
- avoid_empty_else
11+
- avoid_relative_lib_imports
12+
- avoid_return_types_on_setters
13+
- avoid_types_as_parameter_names
14+
- no_duplicate_case_values
15+
- prefer_contains
16+
- prefer_equal_for_default_values
17+
- prefer_is_empty
18+
- prefer_is_not_empty
19+
- recursive_getters
20+
- unrelated_type_equality_checks
21+
- use_rethrow_when_possible
22+
- unawaited_futures
23+
- valid_regexps

lib/analysis_options.1.4.0.yaml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
2+
# for details. All rights reserved. Use of this source code is governed by a
3+
# BSD-style license that can be found in the LICENSE file.
4+
#
5+
# Google internally enforced rules. See README.md for more information,
6+
# including a list of lints that are intentionally _not_ enforced.
7+
8+
linter:
9+
rules:
10+
- avoid_empty_else
11+
- avoid_init_to_null
12+
- avoid_relative_lib_imports
13+
- avoid_return_types_on_setters
14+
- avoid_types_as_parameter_names
15+
- no_duplicate_case_values
16+
- null_closures
17+
- prefer_contains
18+
- prefer_equal_for_default_values
19+
- prefer_is_empty
20+
- prefer_is_not_empty
21+
- recursive_getters
22+
- unrelated_type_equality_checks
23+
- use_rethrow_when_possible
24+
- unawaited_futures
25+
- valid_regexps

lib/analysis_options.1.5.0.yaml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
2+
# for details. All rights reserved. Use of this source code is governed by a
3+
# BSD-style license that can be found in the LICENSE file.
4+
#
5+
# Google internally enforced rules. See README.md for more information,
6+
# including a list of lints that are intentionally _not_ enforced.
7+
8+
linter:
9+
rules:
10+
- avoid_empty_else
11+
- avoid_init_to_null
12+
- avoid_relative_lib_imports
13+
- avoid_return_types_on_setters
14+
- avoid_shadowing_type_parameters
15+
- avoid_types_as_parameter_names
16+
- empty_constructor_bodies
17+
- no_duplicate_case_values
18+
- null_closures
19+
- prefer_contains
20+
- prefer_equal_for_default_values
21+
- prefer_is_empty
22+
- prefer_is_not_empty
23+
- recursive_getters
24+
- slash_for_doc_comments
25+
- unawaited_futures
26+
- unrelated_type_equality_checks
27+
- use_rethrow_when_possible
28+
- valid_regexps

lib/analysis_options.1.6.0.yaml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
2+
# for details. All rights reserved. Use of this source code is governed by a
3+
# BSD-style license that can be found in the LICENSE file.
4+
#
5+
# Google internally enforced rules. See README.md for more information,
6+
# including a list of lints that are intentionally _not_ enforced.
7+
8+
linter:
9+
rules:
10+
- avoid_empty_else
11+
- avoid_init_to_null
12+
- avoid_relative_lib_imports
13+
- avoid_return_types_on_setters
14+
- avoid_shadowing_type_parameters
15+
- avoid_types_as_parameter_names
16+
- curly_braces_in_flow_control_structures
17+
- empty_catches
18+
- empty_constructor_bodies
19+
- library_names
20+
- library_prefixes
21+
- no_duplicate_case_values
22+
- null_closures
23+
- prefer_contains
24+
- prefer_equal_for_default_values
25+
- prefer_is_empty
26+
- prefer_is_not_empty
27+
- recursive_getters
28+
- slash_for_doc_comments
29+
- type_init_formals
30+
- unawaited_futures
31+
- unnecessary_null_in_if_null_operators
32+
- unrelated_type_equality_checks
33+
- use_rethrow_when_possible
34+
- valid_regexps

lib/analysis_options.1.7.0.yaml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
2+
# for details. All rights reserved. Use of this source code is governed by a
3+
# BSD-style license that can be found in the LICENSE file.
4+
#
5+
# Google internally enforced rules. See README.md for more information,
6+
# including a list of lints that are intentionally _not_ enforced.
7+
8+
linter:
9+
rules:
10+
- avoid_empty_else
11+
- avoid_init_to_null
12+
- avoid_relative_lib_imports
13+
- avoid_return_types_on_setters
14+
- avoid_shadowing_type_parameters
15+
- avoid_types_as_parameter_names
16+
- curly_braces_in_flow_control_structures
17+
- empty_catches
18+
- empty_constructor_bodies
19+
- library_names
20+
- library_prefixes
21+
- no_duplicate_case_values
22+
- null_closures
23+
- prefer_contains
24+
- prefer_equal_for_default_values
25+
- prefer_is_empty
26+
- prefer_is_not_empty
27+
- recursive_getters
28+
- slash_for_doc_comments
29+
- type_init_formals
30+
- unawaited_futures
31+
- unnecessary_null_in_if_null_operators
32+
- unrelated_type_equality_checks
33+
- use_rethrow_when_possible
34+
- valid_regexps

lib/analysis_options.yaml

+6-27
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,10 @@
44
#
55
# Google internally enforced rules. See README.md for more information,
66
# including a list of lints that are intentionally _not_ enforced.
7+
#
8+
# Include this file if you want to always use the latest version. If your
9+
# continuous build and/or presubmit check lints then they will likely fail
10+
# whenever a new version of `package:pedantic` is released. To avoid this,
11+
# specify a specific version of `analysis_options.yaml` instead.
712

8-
linter:
9-
rules:
10-
- avoid_empty_else
11-
- avoid_init_to_null
12-
- avoid_relative_lib_imports
13-
- avoid_return_types_on_setters
14-
- avoid_shadowing_type_parameters
15-
- avoid_types_as_parameter_names
16-
- curly_braces_in_flow_control_structures
17-
- empty_catches
18-
- empty_constructor_bodies
19-
- library_names
20-
- library_prefixes
21-
- no_duplicate_case_values
22-
- null_closures
23-
- prefer_contains
24-
- prefer_equal_for_default_values
25-
- prefer_is_empty
26-
- prefer_is_not_empty
27-
- recursive_getters
28-
- slash_for_doc_comments
29-
- type_init_formals
30-
- unawaited_futures
31-
- unnecessary_null_in_if_null_operators
32-
- unrelated_type_equality_checks
33-
- use_rethrow_when_possible
34-
- valid_regexps
13+
include: package:pedantic/analysis_options.1.7.0.yaml

pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: pedantic
2-
version: 1.6.0
2+
version: 1.7.0
33
description: How to get the most value from Dart static analysis.
44
author: Dart Team <[email protected]>
55
homepage: https://github.com/dart-lang/pedantic

0 commit comments

Comments
 (0)