Skip to content

Commit e0c3429

Browse files
authored
Add codacy init without token tests (#128)
* Add codacy init without token tests
1 parent cb2527b commit e0c3429

File tree

10 files changed

+3863
-3
lines changed

10 files changed

+3863
-3
lines changed

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: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
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+
linter:
31+
rules:
32+
always_declare_return_types: "true"
33+
always_put_control_body_on_new_line: "true"
34+
always_put_required_named_parameters_first: "true"
35+
always_require_non_null_named_parameters: "true"
36+
always_specify_types: "true"
37+
annotate_overrides: "true"
38+
avoid_annotating_with_dynamic: "true"
39+
avoid_as: "true"
40+
avoid_bool_literals_in_conditional_expressions: "true"
41+
avoid_catches_without_on_clauses: "true"
42+
avoid_catching_errors: "true"
43+
avoid_classes_with_only_static_members: "true"
44+
avoid_double_and_int_checks: "true"
45+
avoid_equals_and_hash_code_on_mutable_classes: "true"
46+
avoid_escaping_inner_quotes: "true"
47+
avoid_field_initializers_in_const_classes: "true"
48+
avoid_final_parameters: "true"
49+
avoid_function_literals_in_foreach_calls: "true"
50+
avoid_implementing_value_types: "true"
51+
avoid_init_to_null: "true"
52+
avoid_js_rounded_ints: "true"
53+
avoid_multiple_declarations_per_line: "true"
54+
avoid_null_checks_in_equality_operators: "true"
55+
avoid_positional_boolean_parameters: "true"
56+
avoid_private_typedef_functions: "true"
57+
avoid_redundant_argument_values: "true"
58+
avoid_renaming_method_parameters: "true"
59+
avoid_return_types_on_setters: "true"
60+
avoid_returning_null: "true"
61+
avoid_returning_null_for_void: "true"
62+
avoid_returning_this: "true"
63+
avoid_setters_without_getters: "true"
64+
avoid_shadowing_type_parameters: "true"
65+
avoid_single_cascade_in_expression_statements: "true"
66+
avoid_types_on_closure_parameters: "true"
67+
avoid_unnecessary_containers: "true"
68+
avoid_unused_constructor_parameters: "true"
69+
avoid_void_async: "true"
70+
await_only_futures: "true"
71+
camel_case_extensions: "true"
72+
camel_case_types: "true"
73+
cascade_invocations: "true"
74+
cast_nullable_to_non_nullable: "true"
75+
combinators_ordering: "true"
76+
conditional_uri_does_not_exist: "true"
77+
constant_identifier_names: "true"
78+
curly_braces_in_flow_control_structures: "true"
79+
dangling_library_doc_comments: "true"
80+
deprecated_consistency: "true"
81+
directives_ordering: "true"
82+
do_not_use_environment: "true"
83+
empty_catches: "true"
84+
empty_constructor_bodies: "true"
85+
enable_null_safety: "true"
86+
eol_at_end_of_file: "true"
87+
exhaustive_cases: "true"
88+
file_names: "true"
89+
flutter_style_todos: "true"
90+
implementation_imports: "true"
91+
implicit_call_tearoffs: "true"
92+
join_return_with_assignment: "true"
93+
leading_newlines_in_multiline_strings: "true"
94+
library_annotations: "true"
95+
library_names: "true"
96+
library_prefixes: "true"
97+
library_private_types_in_public_api: "true"
98+
lines_longer_than_80_chars: "true"
99+
missing_whitespace_between_adjacent_strings: "true"
100+
no_default_cases: "true"
101+
no_leading_underscores_for_library_prefixes: "true"
102+
no_leading_underscores_for_local_identifiers: "true"
103+
no_runtimeType_toString: "true"
104+
non_constant_identifier_names: "true"
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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+
}
17+
}
18+
];
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+
Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
<?xml version="1.0"?>
2+
<ruleset name="Codacy PMD Ruleset"
3+
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 https://pmd.sourceforge.io/ruleset_2_0_0.xsd">
6+
<description>Codacy PMD Ruleset</description>
7+
8+
<rule ref="category/apex/design.xml/AvoidDeeplyNestedIfStmts"/>
9+
<rule ref="category/apex/design.xml/ExcessiveClassLength"/>
10+
<rule ref="category/apex/design.xml/ExcessiveParameterList"/>
11+
<rule ref="category/apex/design.xml/ExcessivePublicCount"/>
12+
<rule ref="category/apex/security.xml/ApexBadCrypto"/>
13+
<rule ref="category/apex/security.xml/ApexCRUDViolation"/>
14+
<rule ref="category/apex/security.xml/ApexDangerousMethods"/>
15+
<rule ref="category/apex/security.xml/ApexInsecureEndpoint"/>
16+
<rule ref="category/apex/security.xml/ApexOpenRedirect"/>
17+
<rule ref="category/apex/security.xml/ApexSOQLInjection"/>
18+
<rule ref="category/apex/security.xml/ApexSharingViolations"/>
19+
<rule ref="category/apex/security.xml/ApexSuggestUsingNamedCred"/>
20+
<rule ref="category/apex/security.xml/ApexXSSFromEscapeFalse"/>
21+
<rule ref="category/apex/security.xml/ApexXSSFromURLParam"/>
22+
<rule ref="category/ecmascript/bestpractices.xml/AvoidWithStatement"/>
23+
<rule ref="category/ecmascript/bestpractices.xml/ConsistentReturn"/>
24+
<rule ref="category/ecmascript/bestpractices.xml/UseBaseWithParseInt"/>
25+
<rule ref="category/ecmascript/codestyle.xml/AssignmentInOperand">
26+
<properties>
27+
<property name="allowWhile" value="false"/>
28+
<property name="allowIf" value="false"/>
29+
<property name="allowTernaryResults" value="false"/>
30+
<property name="allowTernary" value="false"/>
31+
<property name="allowFor" value="false"/>
32+
<property name="allowIncrementDecrement" value="false"/>
33+
</properties>
34+
</rule>
35+
<rule ref="category/ecmascript/codestyle.xml/UnnecessaryBlock"/>
36+
<rule ref="category/ecmascript/errorprone.xml/EqualComparison"/>
37+
<rule ref="category/ecmascript/errorprone.xml/InnaccurateNumericLiteral"/>
38+
<rule ref="category/java/bestpractices.xml/AvoidReassigningParameters"/>
39+
<rule ref="category/java/bestpractices.xml/CheckResultSet"/>
40+
<rule ref="category/java/bestpractices.xml/JUnitTestsShouldIncludeAssert"/>
41+
<rule ref="category/java/bestpractices.xml/OneDeclarationPerLine">
42+
<properties>
43+
<property name="strictMode" value="false"/>
44+
</properties>
45+
</rule>
46+
<rule ref="category/java/bestpractices.xml/SwitchStmtsShouldHaveDefault"/>
47+
<rule ref="category/java/bestpractices.xml/UnusedFormalParameter"/>
48+
<rule ref="category/java/bestpractices.xml/UnusedLocalVariable"/>
49+
<rule ref="category/java/bestpractices.xml/UnusedPrivateField"/>
50+
<rule ref="category/java/bestpractices.xml/UnusedPrivateMethod"/>
51+
<rule ref="category/java/codestyle.xml/ClassNamingConventions">
52+
<properties>
53+
<property name="testClassPattern" value="^Test.*$|^[A-Z][a-zA-Z0-9]*Test(s|Case)?$"/>
54+
<property name="abstractClassPattern" value="[A-Z][a-zA-Z0-9]*"/>
55+
<property name="classPattern" value="[A-Z][a-zA-Z0-9]*"/>
56+
<property name="utilityClassPattern" value="[A-Z][a-zA-Z0-9]*"/>
57+
<property name="annotationPattern" value="[A-Z][a-zA-Z0-9]*"/>
58+
<property name="enumPattern" value="[A-Z][a-zA-Z0-9]*"/>
59+
<property name="interfacePattern" value="[A-Z][a-zA-Z0-9]*"/>
60+
</properties>
61+
</rule>
62+
<rule ref="category/java/codestyle.xml/ExtendsObject"/>
63+
<rule ref="category/java/codestyle.xml/FieldDeclarationsShouldBeAtStartOfClass"/>
64+
<rule ref="category/java/codestyle.xml/GenericsNaming"/>
65+
<rule ref="category/java/codestyle.xml/MethodNamingConventions">
66+
<properties>
67+
<property name="junit3TestPattern" value="test[A-Z0-9][a-zA-Z0-9]*"/>
68+
<property name="junit5TestPattern" value="[a-z][a-zA-Z0-9]*"/>
69+
<property name="staticPattern" value="[a-z][a-zA-Z0-9]*"/>
70+
<property name="methodPattern" value="[a-z][a-zA-Z0-9]*"/>
71+
<property name="junit4TestPattern" value="[a-z][a-zA-Z0-9]*"/>
72+
<property name="nativePattern" value="[a-z][a-zA-Z0-9]*"/>
73+
</properties>
74+
</rule>
75+
<rule ref="category/java/codestyle.xml/NoPackage"/>
76+
<rule ref="category/java/codestyle.xml/PackageCase"/>
77+
<rule ref="category/java/codestyle.xml/UnnecessaryConstructor"/>
78+
<rule ref="category/java/codestyle.xml/UnnecessaryFullyQualifiedName"/>
79+
<rule ref="category/java/codestyle.xml/UnnecessaryReturn"/>
80+
<rule ref="category/java/design.xml/AvoidThrowingNullPointerException"/>
81+
<rule ref="category/java/design.xml/AvoidThrowingRawExceptionTypes"/>
82+
<rule ref="category/java/design.xml/CollapsibleIfStatements"/>
83+
<rule ref="category/java/design.xml/ExcessiveParameterList"/>
84+
<rule ref="category/java/design.xml/LogicInversion"/>
85+
<rule ref="category/java/design.xml/NPathComplexity"/>
86+
<rule ref="category/java/design.xml/SimplifyBooleanExpressions"/>
87+
<rule ref="category/java/design.xml/SimplifyBooleanReturns"/>
88+
<rule ref="category/java/design.xml/SingularField"/>
89+
<rule ref="category/java/documentation.xml/UncommentedEmptyMethodBody"/>
90+
<rule ref="category/java/errorprone.xml/AssignmentToNonFinalStatic"/>
91+
<rule ref="category/java/errorprone.xml/AvoidAccessibilityAlteration"/>
92+
<rule ref="category/java/errorprone.xml/AvoidBranchingStatementAsLastInLoop"/>
93+
<rule ref="category/java/errorprone.xml/AvoidCallingFinalize"/>
94+
<rule ref="category/java/errorprone.xml/AvoidDecimalLiteralsInBigDecimalConstructor"/>
95+
<rule ref="category/java/errorprone.xml/AvoidInstanceofChecksInCatchClause"/>
96+
<rule ref="category/java/errorprone.xml/AvoidMultipleUnaryOperators"/>
97+
<rule ref="category/java/errorprone.xml/BrokenNullCheck"/>
98+
<rule ref="category/java/errorprone.xml/CheckSkipResult"/>
99+
<rule ref="category/java/errorprone.xml/CompareObjectsWithEquals">
100+
<properties>
101+
<property name="typesThatCompareByReference" value="java.lang.Enum,java.lang.Class"/>
102+
</properties>
103+
</rule>
104+
<rule ref="category/java/errorprone.xml/DoNotHardCodeSDCard"/>
105+
<rule ref="category/java/errorprone.xml/DontUseFloatTypeForLoopIndices"/>
106+
<rule ref="category/java/errorprone.xml/EmptyFinalizer"/>
107+
<rule ref="category/java/errorprone.xml/EqualsNull"/>
108+
<rule ref="category/java/errorprone.xml/JUnitSpelling"/>
109+
<rule ref="category/java/errorprone.xml/JUnitStaticSuite"/>
110+
<rule ref="category/java/errorprone.xml/JumbledIncrementer"/>
111+
<rule ref="category/java/errorprone.xml/MethodWithSameNameAsEnclosingClass"/>
112+
<rule ref="category/java/errorprone.xml/MisplacedNullCheck"/>
113+
<rule ref="category/java/errorprone.xml/MissingStaticMethodInNonInstantiatableClass">
114+
<properties>
115+
<property name="annotations" value="org.springframework.beans.factory.annotation.Autowired,javax.inject.Inject"/>
116+
</properties>
117+
</rule>
118+
<rule ref="category/java/errorprone.xml/NonCaseLabelInSwitchStatement"/>
119+
<rule ref="category/java/errorprone.xml/NonStaticInitializer"/>
120+
<rule ref="category/java/errorprone.xml/ReturnFromFinallyBlock"/>
121+
<rule ref="category/java/errorprone.xml/UnconditionalIfStatement"/>
122+
<rule ref="category/java/errorprone.xml/UnnecessaryBooleanAssertion"/>
123+
<rule ref="category/java/errorprone.xml/UnnecessaryCaseChange"/>
124+
<rule ref="category/java/errorprone.xml/UseEqualsToCompareStrings"/>
125+
<rule ref="category/java/errorprone.xml/UselessOperationOnImmutable"/>
126+
<rule ref="category/java/multithreading.xml/AvoidThreadGroup"/>
127+
<rule ref="category/java/multithreading.xml/DontCallThreadRun"/>
128+
<rule ref="category/java/performance.xml/StringInstantiation"/>
129+
<rule ref="category/java/performance.xml/StringToString"/>
130+
<rule ref="category/java/performance.xml/UseStringBufferLength"/>
131+
<rule ref="category/jsp/bestpractices.xml/DontNestJsfInJstlIteration"/>
132+
<rule ref="category/jsp/bestpractices.xml/NoClassAttribute"/>
133+
<rule ref="category/jsp/bestpractices.xml/NoHtmlComments"/>
134+
<rule ref="category/jsp/bestpractices.xml/NoJspForward"/>
135+
<rule ref="category/jsp/codestyle.xml/DuplicateJspImports"/>
136+
<rule ref="category/jsp/design.xml/NoInlineScript"/>
137+
<rule ref="category/jsp/design.xml/NoInlineStyleInformation"/>
138+
<rule ref="category/jsp/design.xml/NoLongScripts"/>
139+
<rule ref="category/jsp/design.xml/NoScriptlets"/>
140+
<rule ref="category/jsp/errorprone.xml/JspEncoding"/>
141+
<rule ref="category/jsp/security.xml/IframeMissingSrcAttribute"/>
142+
<rule ref="category/jsp/security.xml/NoUnsanitizedJSPExpression"/>
143+
<rule ref="category/plsql/bestpractices.xml/TomKytesDespair"/>
144+
<rule ref="category/plsql/codestyle.xml/MisplacedPragma"/>
145+
<rule ref="category/plsql/design.xml/ExcessiveMethodLength"/>
146+
<rule ref="category/plsql/design.xml/ExcessiveObjectLength"/>
147+
<rule ref="category/plsql/design.xml/ExcessivePackageBodyLength"/>
148+
</ruleset>

0 commit comments

Comments
 (0)