Skip to content

Commit 795ee33

Browse files
committed
Add codacy default config tests
1 parent cb2527b commit 795ee33

File tree

9 files changed

+35222
-2
lines changed

9 files changed

+35222
-2
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
runtimes:
2+
3+
4+
5+
6+
tools:
7+
8+
9+
10+
11+
12+
13+

integration-tests/init-without-token/expected/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
tools-configs/
33
.gitignore
44
cli-config.yaml
5-
logs/
5+
logs/

integration-tests/init-without-token/expected/codacy.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ tools:
1010
1111
1212
13-
13+
Lines changed: 222 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,222 @@
1+
analyzer:
2+
errors:
3+
always_use_package_imports: error
4+
avoid_dynamic_calls: error
5+
avoid_empty_else: error
6+
avoid_print: error
7+
avoid_relative_lib_imports: error
8+
avoid_returning_null_for_future: error
9+
avoid_slow_async_io: error
10+
avoid_type_to_string: error
11+
avoid_types_as_parameter_names: error
12+
avoid_web_libraries_in_flutter: error
13+
cancel_subscriptions: error
14+
close_sinks: error
15+
collection_methods_unrelated_type: error
16+
comment_references: error
17+
control_flow_in_finally: error
18+
depend_on_referenced_packages: info
19+
diagnostic_describe_all_properties: error
20+
discarded_futures: error
21+
empty_statements: error
22+
hash_and_equals: error
23+
invariant_booleans: error
24+
iterable_contains_unrelated_type: error
25+
list_remove_unrelated_type: error
26+
literal_only_boolean_expressions: error
27+
no_adjacent_strings_in_list: error
28+
no_duplicate_case_values: error
29+
no_logic_in_create_state: error
30+
package_names: info
31+
prefer_relative_imports: error
32+
prefer_void_to_null: error
33+
secure_pubspec_urls: info
34+
sort_pub_dependencies: info
35+
test_types_in_equals: error
36+
throw_in_finally: error
37+
unnecessary_statements: error
38+
unrelated_type_equality_checks: error
39+
unsafe_html: error
40+
use_build_context_synchronously: error
41+
use_key_in_widget_constructors: error
42+
valid_regexps: error
43+
linter:
44+
rules:
45+
always_declare_return_types: "true"
46+
always_put_control_body_on_new_line: "true"
47+
always_put_required_named_parameters_first: "true"
48+
always_require_non_null_named_parameters: "true"
49+
always_specify_types: "true"
50+
annotate_overrides: "true"
51+
avoid_annotating_with_dynamic: "true"
52+
avoid_as: "true"
53+
avoid_bool_literals_in_conditional_expressions: "true"
54+
avoid_catches_without_on_clauses: "true"
55+
avoid_catching_errors: "true"
56+
avoid_classes_with_only_static_members: "true"
57+
avoid_double_and_int_checks: "true"
58+
avoid_equals_and_hash_code_on_mutable_classes: "true"
59+
avoid_escaping_inner_quotes: "true"
60+
avoid_field_initializers_in_const_classes: "true"
61+
avoid_final_parameters: "true"
62+
avoid_function_literals_in_foreach_calls: "true"
63+
avoid_implementing_value_types: "true"
64+
avoid_init_to_null: "true"
65+
avoid_js_rounded_ints: "true"
66+
avoid_multiple_declarations_per_line: "true"
67+
avoid_null_checks_in_equality_operators: "true"
68+
avoid_positional_boolean_parameters: "true"
69+
avoid_private_typedef_functions: "true"
70+
avoid_redundant_argument_values: "true"
71+
avoid_renaming_method_parameters: "true"
72+
avoid_return_types_on_setters: "true"
73+
avoid_returning_null: "true"
74+
avoid_returning_null_for_void: "true"
75+
avoid_returning_this: "true"
76+
avoid_setters_without_getters: "true"
77+
avoid_shadowing_type_parameters: "true"
78+
avoid_single_cascade_in_expression_statements: "true"
79+
avoid_types_on_closure_parameters: "true"
80+
avoid_unnecessary_containers: "true"
81+
avoid_unused_constructor_parameters: "true"
82+
avoid_void_async: "true"
83+
await_only_futures: "true"
84+
camel_case_extensions: "true"
85+
camel_case_types: "true"
86+
cascade_invocations: "true"
87+
cast_nullable_to_non_nullable: "true"
88+
combinators_ordering: "true"
89+
conditional_uri_does_not_exist: "true"
90+
constant_identifier_names: "true"
91+
curly_braces_in_flow_control_structures: "true"
92+
dangling_library_doc_comments: "true"
93+
deprecated_consistency: "true"
94+
directives_ordering: "true"
95+
do_not_use_environment: "true"
96+
empty_catches: "true"
97+
empty_constructor_bodies: "true"
98+
enable_null_safety: "true"
99+
eol_at_end_of_file: "true"
100+
exhaustive_cases: "true"
101+
file_names: "true"
102+
flutter_style_todos: "true"
103+
implementation_imports: "true"
104+
implicit_call_tearoffs: "true"
105+
join_return_with_assignment: "true"
106+
leading_newlines_in_multiline_strings: "true"
107+
library_annotations: "true"
108+
library_names: "true"
109+
library_prefixes: "true"
110+
library_private_types_in_public_api: "true"
111+
lines_longer_than_80_chars: "true"
112+
missing_whitespace_between_adjacent_strings: "true"
113+
no_default_cases: "true"
114+
no_leading_underscores_for_library_prefixes: "true"
115+
no_leading_underscores_for_local_identifiers: "true"
116+
no_runtimeType_toString: "true"
117+
non_constant_identifier_names: "true"
118+
noop_primitive_operations: "true"
119+
null_check_on_nullable_type_parameter: "true"
120+
null_closures: "true"
121+
omit_local_variable_types: "true"
122+
one_member_abstracts: "true"
123+
only_throw_errors: "true"
124+
overridden_fields: "true"
125+
package_api_docs: "true"
126+
package_prefixed_library_names: "true"
127+
parameter_assignments: "true"
128+
prefer_adjacent_string_concatenation: "true"
129+
prefer_asserts_in_initializer_lists: "true"
130+
prefer_asserts_with_message: "true"
131+
prefer_bool_in_asserts: "true"
132+
prefer_collection_literals: "true"
133+
prefer_conditional_assignment: "true"
134+
prefer_const_constructors: "true"
135+
prefer_const_constructors_in_immutables: "true"
136+
prefer_const_declarations: "true"
137+
prefer_const_literals_to_create_immutables: "true"
138+
prefer_constructors_over_static_methods: "true"
139+
prefer_contains: "true"
140+
prefer_double_quotes: "true"
141+
prefer_equal_for_default_values: "true"
142+
prefer_expression_function_bodies: "true"
143+
prefer_final_fields: "true"
144+
prefer_final_in_for_each: "true"
145+
prefer_final_locals: "true"
146+
prefer_final_parameters: "true"
147+
prefer_for_elements_to_map_fromIterable: "true"
148+
prefer_foreach: "true"
149+
prefer_function_declarations_over_variables: "true"
150+
prefer_generic_function_type_aliases: "true"
151+
prefer_if_elements_to_conditional_expressions: "true"
152+
prefer_if_null_operators: "true"
153+
prefer_initializing_formals: "true"
154+
prefer_inlined_adds: "true"
155+
prefer_int_literals: "true"
156+
prefer_interpolation_to_compose_strings: "true"
157+
prefer_is_empty: "true"
158+
prefer_is_not_empty: "true"
159+
prefer_is_not_operator: "true"
160+
prefer_iterable_whereType: "true"
161+
prefer_mixin: "true"
162+
prefer_null_aware_method_calls: "true"
163+
prefer_null_aware_operators: "true"
164+
prefer_single_quotes: "true"
165+
prefer_spread_collections: "true"
166+
prefer_typing_uninitialized_variables: "true"
167+
provide_deprecation_message: "true"
168+
public_member_api_docs: "true"
169+
recursive_getters: "true"
170+
require_trailing_commas: "true"
171+
sized_box_for_whitespace: "true"
172+
sized_box_shrink_expand: "true"
173+
slash_for_doc_comments: "true"
174+
sort_child_properties_last: "true"
175+
sort_constructors_first: "true"
176+
sort_unnamed_constructors_first: "true"
177+
super_goes_last: "true"
178+
tighten_type_of_initializing_formals: "true"
179+
type_annotate_public_apis: "true"
180+
type_init_formals: "true"
181+
unawaited_futures: "true"
182+
unnecessary_await_in_return: "true"
183+
unnecessary_brace_in_string_interps: "true"
184+
unnecessary_const: "true"
185+
unnecessary_constructor_name: "true"
186+
unnecessary_final: "true"
187+
unnecessary_getters_setters: "true"
188+
unnecessary_lambdas: "true"
189+
unnecessary_late: "true"
190+
unnecessary_library_directive: "true"
191+
unnecessary_new: "true"
192+
unnecessary_null_aware_assignments: "true"
193+
unnecessary_null_aware_operator_on_extension_on_nullable: "true"
194+
unnecessary_null_checks: "true"
195+
unnecessary_null_in_if_null_operators: "true"
196+
unnecessary_nullable_for_final_variable_declarations: "true"
197+
unnecessary_overrides: "true"
198+
unnecessary_parenthesis: "true"
199+
unnecessary_raw_strings: "true"
200+
unnecessary_string_escapes: "true"
201+
unnecessary_string_interpolations: "true"
202+
unnecessary_this: "true"
203+
unnecessary_to_list_in_spreads: "true"
204+
unreachable_from_main: "true"
205+
use_colored_box: "true"
206+
use_decorated_box: "true"
207+
use_enums: "true"
208+
use_full_hex_values_for_flutter_colors: "true"
209+
use_function_type_syntax_for_parameters: "true"
210+
use_if_null_to_convert_nulls_to_bools: "true"
211+
use_is_even_rather_than_modulo: "true"
212+
use_late_for_private_fields_and_variables: "true"
213+
use_named_constants: "true"
214+
use_raw_strings: "true"
215+
use_rethrow_when_possible: "true"
216+
use_setters_to_change_properties: "true"
217+
use_string_buffers: "true"
218+
use_string_in_part_of_directives: "true"
219+
use_super_parameters: "true"
220+
use_test_throws_matchers: "true"
221+
use_to_and_as_if_applicable: "true"
222+
void_checks: "true"
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
export default [
2+
{
3+
rules: {
4+
"constructor-super": ["error"],
5+
"for-direction": ["error"],
6+
"getter-return": ["error", {"allowImplicit": false}],
7+
"no-async-promise-executor": ["error"],
8+
"no-case-declarations": ["error"],
9+
"no-class-assign": ["error"],
10+
"no-compare-neg-zero": ["error"],
11+
"no-cond-assign": ["error", "except-parens"],
12+
"no-const-assign": ["error"],
13+
"no-constant-condition": ["error", {"checkLoops": true}],
14+
"no-control-regex": ["error"],
15+
"no-debugger": ["error"],
16+
"no-delete-var": ["error"],
17+
"no-dupe-args": ["error"],
18+
"no-dupe-class-members": ["error"],
19+
"no-dupe-else-if": ["error"],
20+
"no-dupe-keys": ["error"],
21+
"no-duplicate-case": ["error"],
22+
"no-empty": ["error", {"allowEmptyCatch": false}],
23+
"no-empty-character-class": ["error"],
24+
"no-empty-pattern": ["error", {"allowObjectPatternsAsParameters": false}],
25+
"no-ex-assign": ["error"],
26+
"no-extra-boolean-cast": ["error", {"enforceForLogicalOperands": false}],
27+
"no-extra-semi": ["error"],
28+
"no-fallthrough": ["error", {"allowEmptyCase": false}],
29+
"no-func-assign": ["error"],
30+
"no-global-assign": ["error"],
31+
"no-import-assign": ["error"],
32+
"no-inner-declarations": ["error", "functions"],
33+
"no-invalid-regexp": ["error"],
34+
"no-irregular-whitespace": ["error", {"skipStrings": true, "skipJSXText": false, "skipRegExps": false, "skipComments": false, "skipTemplates": false}],
35+
"no-loss-of-precision": ["error"],
36+
"no-misleading-character-class": ["error"],
37+
"no-mixed-spaces-and-tabs": ["error"],
38+
"no-new-symbol": ["error"],
39+
"no-nonoctal-decimal-escape": ["error"],
40+
"no-obj-calls": ["error"],
41+
"no-octal": ["error"],
42+
"no-prototype-builtins": ["error"],
43+
"no-redeclare": ["error", {"builtinGlobals": true}],
44+
"no-regex-spaces": ["error"],
45+
"no-self-assign": ["error", {"props": true}],
46+
"no-setter-return": ["error"],
47+
"no-shadow-restricted-names": ["error"],
48+
"no-sparse-arrays": ["error"],
49+
"no-this-before-super": ["error"],
50+
"no-undef": ["error", {"typeof": false}],
51+
"no-unexpected-multiline": ["error"],
52+
"no-unreachable": ["error"],
53+
"no-unsafe-finally": ["error"],
54+
"no-unsafe-negation": ["error", {"enforceForOrderingRelations": false}],
55+
"no-unsafe-optional-chaining": ["error", {"disallowArithmeticOperators": false}],
56+
"no-unused-labels": ["error"],
57+
"no-unused-vars": ["error"],
58+
"no-useless-backreference": ["error"],
59+
"no-useless-catch": ["error"],
60+
"no-useless-escape": ["error"],
61+
"no-with": ["error"],
62+
"require-yield": ["error"],
63+
"use-isnan": ["error", {"enforceForSwitchCase": true, "enforceForIndexOf": false}],
64+
"valid-typeof": ["error", {"requireStringLiterals": false}],
65+
}
66+
}
67+
];
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[MASTER]
2+
ignore=CVS
3+
persistent=yes
4+
load-plugins=
5+
6+
[MESSAGES CONTROL]
7+
disable=all
8+
enable=C0123,C0200,C0303,E0100,E0101,E0102,E0103,E0104,E0105,E0106,E0107,E0108,E0110,E0112,E0113,E0114,E0115,E0116,E0117,E0202,E0203,E0211,E0236,E0238,E0239,E0240,E0241,E0301,E0302,E0601,E0603,E0604,E0701,E0702,E0704,E0710,E0711,E0712,E1003,E1102,E1111,E1120,E1121,E1123,E1124,E1125,E1126,E1127,E1132,E1200,E1201,E1205,E1206,E1300,E1301,E1302,E1303,E1304,E1305,E1306,R0202,R0203,W0101,W0102,W0104,W0105,W0106,W0107,W0108,W0109,W0120,W0122,W0124,W0150,W0199,W0221,W0222,W0233,W0404,W0410,W0601,W0602,W0604,W0611,W0612,W0622,W0702,W0705,W0711,W1300,W1301,W1302,W1303,W1305,W1306,W1307
9+

0 commit comments

Comments
 (0)