Skip to content

Commit 37ebb4c

Browse files
Merge pull request #177 from Workiva/proposed_v2
v2 analysis options
2 parents d0a6c37 + d8e680b commit 37ebb4c

File tree

5 files changed

+427
-6
lines changed

5 files changed

+427
-6
lines changed

lib/v1.optional.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ include: package:workiva_analysis_options/v1.recommended.yaml
6969

7070
analyzer:
7171
errors:
72-
# Promote enabled lints to errors:
72+
# Promote enabled lints to warnings:
7373
always_declare_return_types: warning
7474
always_put_required_named_parameters_first: warning
7575
always_specify_types: warning
@@ -83,7 +83,6 @@ analyzer:
8383
control_flow_in_finally: warning
8484
directives_ordering: warning
8585
flutter_style_todos: warning
86-
invariant_booleans: warning
8786
literal_only_boolean_expressions: warning
8887
non_constant_identifier_names: warning
8988
parameter_assignments: warning
@@ -120,7 +119,6 @@ linter:
120119
- control_flow_in_finally
121120
- directives_ordering
122121
- flutter_style_todos
123-
- invariant_booleans
124122
- literal_only_boolean_expressions
125123
- non_constant_identifier_names
126124
- parameter_assignments

lib/v1.recommended.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ include: package:workiva_analysis_options/v1.yaml
6565

6666
analyzer:
6767
errors:
68-
# Promote enabled lints to errors:
68+
# Promote enabled lints to warnings:
6969
always_require_non_null_named_parameters: warning
7070
avoid_bool_literals_in_conditional_expressions: warning
7171
avoid_function_literals_in_foreach_calls: warning

lib/v1.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ analyzer:
7474
sdk_version_ui_as_code: warning
7575
sdk_version_ui_as_code_in_const_context: warning
7676

77-
# Promote some builtin hints/infos/warnings to errors:
77+
# Promote some builtin hints to warnings:
7878
dead_code: warning
7979
duplicate_hidden_name: warning
8080
duplicate_import: warning
@@ -88,7 +88,7 @@ analyzer:
8888
unused_local_variable: warning
8989
unused_shown_name: warning
9090

91-
# Promote enabled lints to errors:
91+
# Promote enabled lints to warnings:
9292
annotate_overrides: warning
9393
avoid_double_and_int_checks: warning
9494
avoid_empty_else: warning

lib/v2.recommended.yaml

Lines changed: 223 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,223 @@
1+
# Copyright 2019 Workiva, Inc.
2+
#
3+
# Redistribution and use in source and binary forms, with or without modification,
4+
# are permitted provided that the following conditions are met:
5+
#
6+
# 1. Redistributions of source code must retain the above copyright notice, this
7+
# list of conditions and the following disclaimer.
8+
#
9+
# 2. Redistributions in binary form must reproduce the above copyright notice,
10+
# this list of conditions and the following disclaimer in the documentation and/or
11+
# other materials provided with the distribution.
12+
#
13+
# 3. Neither the name of the copyright holder nor the names of its contributors
14+
# may be used to endorse or promote products derived from this software without
15+
# specific prior written permission.
16+
#
17+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18+
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19+
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20+
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
21+
# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22+
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23+
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
24+
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25+
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26+
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27+
#
28+
# This software is derived from pedantic (https://github.com/dart-lang/pedantic)
29+
# with separate copyright notices and license terms:
30+
#
31+
# Copyright 2017, the Dart project authors. All rights reserved.
32+
# Redistribution and use in source and binary forms, with or without
33+
# modification, are permitted provided that the following conditions are
34+
# met:
35+
#
36+
# Redistributions of source code must retain the above copyright
37+
# notice, this list of conditions and the following disclaimer.
38+
# Redistributions in binary form must reproduce the above
39+
# copyright notice, this list of conditions and the following
40+
# disclaimer in the documentation and/or other materials provided
41+
# with the distribution.
42+
# Neither the name of Google Inc. nor the names of its
43+
# contributors may be used to endorse or promote products derived
44+
# from this software without specific prior written permission.
45+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
46+
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
47+
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
48+
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
49+
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
50+
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
51+
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
52+
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
53+
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
54+
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
55+
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
56+
57+
# Every lint in this file is categorized as "recommended".
58+
#
59+
# For context on that decision or to discuss a change for any individual lint,
60+
# visit this issue and search for the lint by its name:
61+
# https://github.com/Workiva/workiva_analysis_options/issues/2
62+
63+
# This file also includes all of the required rules.
64+
include: package:workiva_analysis_options/v1.yaml
65+
66+
analyzer:
67+
errors:
68+
# Promote enabled lints to warnings:
69+
always_declare_return_types: warning
70+
always_put_required_named_parameters_first: warning
71+
always_require_non_null_named_parameters: warning
72+
avoid_bool_literals_in_conditional_expressions: warning
73+
avoid_function_literals_in_foreach_calls: warning
74+
avoid_implementing_value_types: warning
75+
avoid_js_rounded_ints: warning
76+
avoid_null_checks_in_equality_operators: warning
77+
avoid_positional_boolean_parameters: warning
78+
avoid_relative_lib_imports: warning
79+
avoid_renaming_method_parameters: warning
80+
avoid_returning_this: warning
81+
avoid_returning_null: warning
82+
avoid_returning_null_for_future: warning
83+
avoid_returning_null_for_void: warning
84+
avoid_setters_without_getters: warning
85+
avoid_slow_async_io: warning
86+
avoid_type_to_string: warning
87+
avoid_types_on_closure_parameters: warning
88+
avoid_unused_constructor_parameters: warning
89+
cascade_invocations: warning
90+
comment_references: warning
91+
control_flow_in_finally: warning
92+
curly_braces_in_flow_control_structures: warning
93+
directives_ordering: warning
94+
join_return_with_assignment: warning
95+
literal_only_boolean_expressions: warning
96+
omit_local_variable_types: warning
97+
overridden_fields: warning
98+
package_api_docs: warning
99+
package_prefixed_library_names: warning
100+
package_names: warning
101+
prefer_adjacent_string_concatenation: warning
102+
prefer_asserts_in_initializer_lists: warning
103+
prefer_collection_literals: warning
104+
prefer_conditional_assignment: warning
105+
prefer_const_constructors_in_immutables: warning
106+
prefer_const_declarations: warning
107+
prefer_const_literals_to_create_immutables: warning
108+
prefer_constructors_over_static_methods: warning
109+
prefer_typing_uninitialized_variables: warning
110+
prefer_final_fields: warning
111+
prefer_final_in_for_each: warning
112+
prefer_final_locals: warning
113+
prefer_function_declarations_over_variables: warning
114+
prefer_if_elements_to_conditional_expressions: warning
115+
prefer_initializing_formals: warning
116+
prefer_inlined_adds: warning
117+
prefer_int_literals: warning
118+
prefer_interpolation_to_compose_strings: warning
119+
prefer_iterable_whereType: warning
120+
prefer_mixin: warning
121+
prefer_null_aware_operators: warning
122+
prefer_single_quotes: warning
123+
prefer_spread_collections: warning
124+
prefer_void_to_null: warning
125+
provide_deprecation_message: warning
126+
sort_pub_dependencies: warning
127+
sort_unnamed_constructors_first: warning
128+
test_types_in_equals: warning
129+
throw_in_finally: warning
130+
type_annotate_public_apis: warning
131+
unawaited_futures: warning
132+
unnecessary_await_in_return: warning
133+
unnecessary_brace_in_string_interps: warning
134+
unnecessary_getters_setters: warning
135+
unnecessary_lambdas: warning
136+
unnecessary_parenthesis: warning
137+
unnecessary_overrides: warning
138+
unnecessary_string_escapes: warning
139+
unnecessary_string_interpolations: warning
140+
unnecessary_this: warning
141+
use_function_type_syntax_for_parameters: warning
142+
use_rethrow_when_possible: warning
143+
use_string_buffers: warning
144+
use_to_and_as_if_applicable: warning
145+
146+
linter:
147+
rules:
148+
- always_declare_return_types
149+
- always_put_required_named_parameters_first
150+
- always_require_non_null_named_parameters
151+
- avoid_bool_literals_in_conditional_expressions
152+
- avoid_function_literals_in_foreach_calls
153+
- avoid_implementing_value_types
154+
- avoid_js_rounded_ints
155+
- avoid_null_checks_in_equality_operators
156+
- avoid_positional_boolean_parameters
157+
- avoid_relative_lib_imports
158+
- avoid_renaming_method_parameters
159+
- avoid_returning_this
160+
- avoid_returning_null
161+
- avoid_returning_null_for_future
162+
- avoid_returning_null_for_void
163+
- avoid_setters_without_getters
164+
- avoid_slow_async_io
165+
- avoid_type_to_string
166+
- avoid_types_on_closure_parameters
167+
- avoid_unused_constructor_parameters
168+
- cascade_invocations
169+
- comment_references
170+
- control_flow_in_finally
171+
- curly_braces_in_flow_control_structures
172+
- directives_ordering
173+
- join_return_with_assignment
174+
- literal_only_boolean_expressions
175+
- omit_local_variable_types
176+
- overridden_fields
177+
- package_api_docs
178+
- package_prefixed_library_names
179+
- package_names
180+
- prefer_adjacent_string_concatenation
181+
- prefer_asserts_in_initializer_lists
182+
- prefer_collection_literals
183+
- prefer_conditional_assignment
184+
- prefer_const_constructors_in_immutables
185+
- prefer_const_declarations
186+
- prefer_const_literals_to_create_immutables
187+
- prefer_constructors_over_static_methods
188+
- prefer_typing_uninitialized_variables
189+
- prefer_final_fields
190+
- prefer_final_in_for_each
191+
- prefer_final_locals
192+
- prefer_function_declarations_over_variables
193+
- prefer_if_elements_to_conditional_expressions
194+
- prefer_initializing_formals
195+
- prefer_inlined_adds
196+
- prefer_int_literals
197+
- prefer_interpolation_to_compose_strings
198+
- prefer_iterable_whereType
199+
- prefer_mixin
200+
- prefer_null_aware_operators
201+
- prefer_single_quotes
202+
- prefer_spread_collections
203+
- prefer_void_to_null
204+
- provide_deprecation_message
205+
- sort_pub_dependencies
206+
- sort_unnamed_constructors_first
207+
- test_types_in_equals
208+
- throw_in_finally
209+
- type_annotate_public_apis
210+
- unawaited_futures
211+
- unnecessary_await_in_return
212+
- unnecessary_brace_in_string_interps
213+
- unnecessary_getters_setters
214+
- unnecessary_lambdas
215+
- unnecessary_parenthesis
216+
- unnecessary_overrides
217+
- unnecessary_string_escapes
218+
- unnecessary_string_interpolations
219+
- unnecessary_this
220+
- use_function_type_syntax_for_parameters
221+
- use_rethrow_when_possible
222+
- use_string_buffers
223+
- use_to_and_as_if_applicable

0 commit comments

Comments
 (0)