Skip to content

Commit b7fa856

Browse files
committed
1.格式化代码
1 parent 3f61e82 commit b7fa856

File tree

6 files changed

+64
-55
lines changed

6 files changed

+64
-55
lines changed

.editorconfig

+53-44
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,11 @@ ij_formatter_tags_enabled = false
1313
ij_smart_tabs = false
1414
ij_wrap_on_typing = false
1515

16+
[*.dart]
17+
max_line_length = 80
18+
1619
[*.java]
17-
ij_java_align_consecutive_assignments = false
20+
ij_java_align_consecutive_assignments = true
1821
ij_java_align_consecutive_variable_declarations = true
1922
ij_java_align_group_field_declarations = true
2023
ij_java_align_multiline_annotation_parameters = false
@@ -28,12 +31,12 @@ ij_java_align_multiline_method_parentheses = false
2831
ij_java_align_multiline_parameters = true
2932
ij_java_align_multiline_parameters_in_calls = false
3033
ij_java_align_multiline_parenthesized_expression = false
31-
ij_java_align_multiline_records = true
34+
ij_java_align_multiline_records = false
3235
ij_java_align_multiline_resources = true
3336
ij_java_align_multiline_ternary_operation = false
34-
ij_java_align_multiline_text_blocks = false
37+
ij_java_align_multiline_text_blocks = true
3538
ij_java_align_multiline_throws_list = true
36-
ij_java_align_subsequent_simple_methods = false
39+
ij_java_align_subsequent_simple_methods = true
3740
ij_java_align_throws_keyword = false
3841
ij_java_annotation_parameter_wrap = off
3942
ij_java_array_initializer_new_line_after_left_brace = false
@@ -103,7 +106,7 @@ ij_java_for_statement_wrap = off
103106
ij_java_generate_final_locals = false
104107
ij_java_generate_final_parameters = false
105108
ij_java_if_brace_force = if_multiline
106-
ij_java_imports_layout = android.**,|,androidx.**,|,com.**,|,junit.**,|,net.**,|,org.**,|,java.**,|,javax.**,|,*,|,$*,|
109+
ij_java_imports_layout = android.**, |, androidx.**, |, com.**, |, junit.**, |, net.**, |, org.**, |, java.**, |, javax.**, |, *, |, $*, |
107110
ij_java_indent_case_from_switch = true
108111
ij_java_insert_inner_class_imports = false
109112
ij_java_insert_override_annotation = true
@@ -117,8 +120,8 @@ ij_java_keep_indents_on_empty_lines = false
117120
ij_java_keep_line_breaks = true
118121
ij_java_keep_multiple_expressions_in_one_line = false
119122
ij_java_keep_simple_blocks_in_one_line = false
120-
ij_java_keep_simple_classes_in_one_line = false
121-
ij_java_keep_simple_lambdas_in_one_line = false
123+
ij_java_keep_simple_classes_in_one_line = true
124+
ij_java_keep_simple_lambdas_in_one_line = true
122125
ij_java_keep_simple_methods_in_one_line = false
123126
ij_java_label_indent_absolute = false
124127
ij_java_label_indent_size = 0
@@ -141,13 +144,13 @@ ij_java_parentheses_expression_right_paren_on_new_line = false
141144
ij_java_place_assignment_sign_on_next_line = false
142145
ij_java_prefer_longer_names = true
143146
ij_java_prefer_parameters_wrap = false
144-
ij_java_record_components_wrap = normal
147+
ij_java_record_components_wrap = off
145148
ij_java_repeat_synchronized = true
146149
ij_java_replace_instanceof_and_cast = false
147150
ij_java_replace_null_check = true
148151
ij_java_replace_sum_lambda_with_method_ref = true
149-
ij_java_resource_list_new_line_after_left_paren = false
150-
ij_java_resource_list_right_paren_on_new_line = false
152+
ij_java_resource_list_new_line_after_left_paren = true
153+
ij_java_resource_list_right_paren_on_new_line = true
151154
ij_java_resource_list_wrap = off
152155
ij_java_rparen_on_new_line_in_record_header = false
153156
ij_java_space_after_closing_angle_bracket_in_type_argument = false
@@ -245,7 +248,7 @@ ij_java_wrap_long_lines = false
245248

246249
[*.properties]
247250
ij_properties_align_group_field_declarations = false
248-
ij_properties_keep_blank_lines = false
251+
ij_properties_keep_blank_lines = true
249252
ij_properties_key_value_delimiter = equals
250253
ij_properties_spaces_around_key_value_delimiter = false
251254

@@ -257,7 +260,7 @@ ij_editorconfig_space_before_colon = false
257260
ij_editorconfig_space_before_comma = false
258261
ij_editorconfig_spaces_around_assignment_operators = true
259262

260-
[{*.ant,*.fxml,*.jhm,*.jnlp,*.jrxml,*.rng,*.tld,*.wsdl,*.xml,*.xsd,*.xsl,*.xslt,*.xul}]
263+
[{*.ant, *.fxml, *.jhm, *.jnlp, *.jrxml, *.rng, *.tld, *.wsdl, *.xml, *.xsd, *.xsl, *.xslt, *.xul}]
261264
ij_continuation_indent_size = 4
262265
ij_xml_align_attributes = false
263266
ij_xml_align_text = false
@@ -277,7 +280,7 @@ ij_xml_space_inside_empty_tag = true
277280
ij_xml_text_wrap = normal
278281
ij_xml_use_custom_settings = true
279282

280-
[{*.bash,*.sh,*.zsh}]
283+
[{*.bash, *.sh, *.zsh}]
281284
indent_size = 2
282285
tab_width = 2
283286
ij_shell_binary_ops_start_line = false
@@ -286,7 +289,7 @@ ij_shell_minify_program = false
286289
ij_shell_redirect_followed_by_space = false
287290
ij_shell_switch_cases_indented = false
288291

289-
[{*.c,*.c++,*.cc,*.cp,*.cpp,*.cu,*.cuh,*.cxx,*.h,*.h++,*.hh,*.hp,*.hpp,*.hxx,*.i,*.icc,*.ii,*.inl,*.ino,*.ipp,*.m,*.mm,*.pch,*.tcc,*.tpp}]
292+
[{*.c, *.c++, *.cc, *.cp, *.cpp, *.cu, *.cuh, *.cxx, *.h, *.h++, *.hh, *.hp, *.hpp, *.hxx, *.i, *.icc, *.ii, *.inl, *.ino, *.ipp, *.m, *.mm, *.pch, *.tcc, *.tpp}]
290293
ij_c_add_brief_tag = false
291294
ij_c_add_getter_prefix = true
292295
ij_c_add_setter_prefix = true
@@ -564,7 +567,7 @@ ij_c_while_brace_force = never
564567
ij_c_while_on_new_line = false
565568
ij_c_wrap_property_declaration = off
566569

567-
[{*.cmake,CMakeLists.txt}]
570+
[{*.cmake, CMakeLists.txt}]
568571
ij_cmake_align_multiline_parameters_in_calls = false
569572
ij_cmake_force_commands_case = 2
570573
ij_cmake_keep_blank_lines_in_code = 2
@@ -579,8 +582,8 @@ ij_cmake_spaces_within_method_call_parentheses = false
579582
ij_cmake_spaces_within_method_parentheses = false
580583
ij_cmake_spaces_within_while_parentheses = false
581584

582-
[{*.gant,*.gradle,*.groovy,*.gy}]
583-
ij_groovy_align_group_field_declarations = false
585+
[{*.gant, *.gradle, *.groovy, *.gy}]
586+
ij_groovy_align_group_field_declarations = true
584587
ij_groovy_align_multiline_array_initializer_expression = false
585588
ij_groovy_align_multiline_assignment = false
586589
ij_groovy_align_multiline_binary_operation = false
@@ -593,13 +596,13 @@ ij_groovy_align_multiline_parameters = true
593596
ij_groovy_align_multiline_parameters_in_calls = false
594597
ij_groovy_align_multiline_resources = true
595598
ij_groovy_align_multiline_ternary_operation = false
596-
ij_groovy_align_multiline_throws_list = false
599+
ij_groovy_align_multiline_throws_list = true
597600
ij_groovy_align_named_args_in_map = true
598601
ij_groovy_align_throws_keyword = false
599602
ij_groovy_array_initializer_new_line_after_left_brace = false
600603
ij_groovy_array_initializer_right_brace_on_new_line = false
601604
ij_groovy_array_initializer_wrap = off
602-
ij_groovy_assert_statement_wrap = off
605+
ij_groovy_assert_statement_wrap = split_into_lines
603606
ij_groovy_assignment_wrap = off
604607
ij_groovy_binary_operation_wrap = off
605608
ij_groovy_blank_lines_after_class_header = 0
@@ -622,19 +625,20 @@ ij_groovy_catch_on_new_line = false
622625
ij_groovy_class_annotation_wrap = split_into_lines
623626
ij_groovy_class_brace_style = end_of_line
624627
ij_groovy_class_count_to_use_import_on_demand = 5
625-
ij_groovy_do_while_brace_force = never
628+
ij_groovy_do_while_brace_force = always
626629
ij_groovy_else_on_new_line = false
627-
ij_groovy_enum_constants_wrap = off
628-
ij_groovy_extends_keyword_wrap = off
629-
ij_groovy_extends_list_wrap = off
630+
ij_groovy_enum_constants_wrap = split_into_lines
631+
ij_groovy_extends_keyword_wrap = split_into_lines
632+
ij_groovy_extends_list_wrap = split_into_lines
630633
ij_groovy_field_annotation_wrap = split_into_lines
631634
ij_groovy_finally_on_new_line = false
632-
ij_groovy_for_brace_force = never
635+
ij_groovy_for_brace_force = always
633636
ij_groovy_for_statement_new_line_after_left_paren = false
634637
ij_groovy_for_statement_right_paren_on_new_line = false
635638
ij_groovy_for_statement_wrap = off
636-
ij_groovy_if_brace_force = never
639+
ij_groovy_if_brace_force = if_multiline
637640
ij_groovy_import_annotation_wrap = 2
641+
ij_groovy_imports_layout = *, |, javax.**, java.**, |, $*
638642
ij_groovy_indent_case_from_switch = true
639643
ij_groovy_indent_label_blocks = true
640644
ij_groovy_insert_inner_class_imports = false
@@ -649,7 +653,7 @@ ij_groovy_keep_multiple_expressions_in_one_line = false
649653
ij_groovy_keep_simple_blocks_in_one_line = false
650654
ij_groovy_keep_simple_classes_in_one_line = true
651655
ij_groovy_keep_simple_lambdas_in_one_line = true
652-
ij_groovy_keep_simple_methods_in_one_line = true
656+
ij_groovy_keep_simple_methods_in_one_line = false
653657
ij_groovy_label_indent_absolute = false
654658
ij_groovy_label_indent_size = 0
655659
ij_groovy_lambda_brace_style = end_of_line
@@ -659,17 +663,17 @@ ij_groovy_line_comment_at_first_column = true
659663
ij_groovy_method_annotation_wrap = split_into_lines
660664
ij_groovy_method_brace_style = end_of_line
661665
ij_groovy_method_call_chain_wrap = off
662-
ij_groovy_method_parameters_new_line_after_left_paren = false
663-
ij_groovy_method_parameters_right_paren_on_new_line = false
664-
ij_groovy_method_parameters_wrap = off
666+
ij_groovy_method_parameters_new_line_after_left_paren = true
667+
ij_groovy_method_parameters_right_paren_on_new_line = true
668+
ij_groovy_method_parameters_wrap = split_into_lines
665669
ij_groovy_modifier_list_wrap = false
666670
ij_groovy_names_count_to_use_import_on_demand = 3
667671
ij_groovy_parameter_annotation_wrap = off
668672
ij_groovy_parentheses_expression_new_line_after_left_paren = false
669673
ij_groovy_parentheses_expression_right_paren_on_new_line = false
670674
ij_groovy_prefer_parameters_wrap = false
671-
ij_groovy_resource_list_new_line_after_left_paren = false
672-
ij_groovy_resource_list_right_paren_on_new_line = false
675+
ij_groovy_resource_list_new_line_after_left_paren = true
676+
ij_groovy_resource_list_right_paren_on_new_line = true
673677
ij_groovy_resource_list_wrap = off
674678
ij_groovy_space_after_assert_separator = true
675679
ij_groovy_space_after_colon = true
@@ -745,19 +749,19 @@ ij_groovy_spaces_within_tuple_expression = false
745749
ij_groovy_spaces_within_while_parentheses = false
746750
ij_groovy_special_else_if_treatment = true
747751
ij_groovy_ternary_operation_wrap = off
748-
ij_groovy_throws_keyword_wrap = off
749-
ij_groovy_throws_list_wrap = off
752+
ij_groovy_throws_keyword_wrap = split_into_lines
753+
ij_groovy_throws_list_wrap = normal
750754
ij_groovy_use_flying_geese_braces = false
751755
ij_groovy_use_fq_class_names = false
752756
ij_groovy_use_fq_class_names_in_javadoc = true
753757
ij_groovy_use_relative_indents = false
754758
ij_groovy_use_single_class_imports = true
755759
ij_groovy_variable_annotation_wrap = off
756-
ij_groovy_while_brace_force = never
760+
ij_groovy_while_brace_force = always
757761
ij_groovy_while_on_new_line = false
758762
ij_groovy_wrap_long_lines = false
759763

760-
[{*.gradle.kts,*.kt,*.kts,*.main.kts}]
764+
[{*.gradle.kts, *.kt, *.kts, *.main.kts}]
761765
ij_kotlin_align_in_columns_case_branch = false
762766
ij_kotlin_align_multiline_binary_operation = false
763767
ij_kotlin_align_multiline_extends_list = false
@@ -791,6 +795,7 @@ ij_kotlin_field_annotation_wrap = split_into_lines
791795
ij_kotlin_finally_on_new_line = false
792796
ij_kotlin_if_rparen_on_new_line = true
793797
ij_kotlin_import_nested_classes = false
798+
ij_kotlin_imports_layout = *, java.**, javax.**, kotlin.**, ^
794799
ij_kotlin_insert_whitespaces_in_simple_one_line_method = true
795800
ij_kotlin_keep_blank_lines_before_right_brace = 2
796801
ij_kotlin_keep_blank_lines_in_code = 2
@@ -808,6 +813,7 @@ ij_kotlin_method_parameters_right_paren_on_new_line = true
808813
ij_kotlin_method_parameters_wrap = split_into_lines
809814
ij_kotlin_name_count_to_use_star_import = 5
810815
ij_kotlin_name_count_to_use_star_import_for_members = 3
816+
ij_kotlin_packages_to_use_import_on_demand = java.util.*, kotlinx.android.synthetic.**, io.ktor.**
811817
ij_kotlin_parameter_annotation_wrap = off
812818
ij_kotlin_space_after_comma = true
813819
ij_kotlin_space_after_extend_colon = true
@@ -837,8 +843,7 @@ ij_kotlin_wrap_elvis_expressions = 1
837843
ij_kotlin_wrap_expression_body_functions = 1
838844
ij_kotlin_wrap_first_method_in_call_chain = false
839845

840-
[{*.har,*.json}]
841-
indent_size = 2
846+
[{*.har, *.json}]
842847
ij_json_keep_blank_lines_in_code = 0
843848
ij_json_keep_indents_on_empty_lines = false
844849
ij_json_keep_line_breaks = true
@@ -850,23 +855,23 @@ ij_json_spaces_within_braces = false
850855
ij_json_spaces_within_brackets = false
851856
ij_json_wrap_long_lines = false
852857

853-
[{*.htm,*.html,*.sht,*.shtm,*.shtml}]
854-
ij_html_add_new_line_before_tags = body,div,p,form,h1,h2,h3
858+
[{*.htm, *.html, *.sht, *.shtm, *.shtml}]
859+
ij_html_add_new_line_before_tags = body, div, p, form, h1, h2, h3
855860
ij_html_align_attributes = true
856861
ij_html_align_text = false
857862
ij_html_attribute_wrap = normal
858863
ij_html_block_comment_at_first_column = true
859864
ij_html_do_not_align_children_of_min_lines = 0
860-
ij_html_do_not_break_if_inline_tags = title,h1,h2,h3,h4,h5,h6,p
861-
ij_html_do_not_indent_children_of_tags = html,body,thead,tbody,tfoot
865+
ij_html_do_not_break_if_inline_tags = title, h1, h2, h3, h4, h5, h6, p
866+
ij_html_do_not_indent_children_of_tags = html, body, thead, tbody, tfoot
862867
ij_html_enforce_quotes = false
863-
ij_html_inline_tags = a,abbr,acronym,b,basefont,bdo,big,br,cite,cite,code,dfn,em,font,i,img,input,kbd,label,q,s,samp,select,small,span,strike,strong,sub,sup,textarea,tt,u,var
868+
ij_html_inline_tags = a, abbr, acronym, b, basefont, bdo, big, br, cite, cite, code, dfn, em, font, i, img, input, kbd, label, q, s, samp, select, small, span, strike, strong, sub, sup, textarea, tt, u, var
864869
ij_html_keep_blank_lines = 2
865870
ij_html_keep_indents_on_empty_lines = false
866871
ij_html_keep_line_breaks = true
867872
ij_html_keep_line_breaks_in_text = true
868873
ij_html_keep_whitespaces = false
869-
ij_html_keep_whitespaces_inside = span,pre,textarea
874+
ij_html_keep_whitespaces_inside = span, pre, textarea
870875
ij_html_line_comment_at_first_column = true
871876
ij_html_new_line_after_last_attribute = never
872877
ij_html_new_line_before_first_attribute = never
@@ -876,8 +881,12 @@ ij_html_space_after_tag_name = false
876881
ij_html_space_around_equality_in_attribute = false
877882
ij_html_space_inside_empty_tag = false
878883
ij_html_text_wrap = normal
884+
ij_html_uniform_ident = false
879885

880-
[{*.yaml,*.yml}]
886+
[{*.yaml, *.yml, .analysis_options}]
881887
indent_size = 2
882888
ij_yaml_keep_indents_on_empty_lines = false
883889
ij_yaml_keep_line_breaks = true
890+
ij_yaml_space_before_colon = true
891+
ij_yaml_spaces_within_braces = true
892+
ij_yaml_spaces_within_brackets = true

src/main/java/javadoc/dev_utils/assist/APIGenerateByModule.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public Subnode(
4141
File file,
4242
List<Subnode> lists
4343
) {
44-
this.subFile = file;
44+
this.subFile = file;
4545
this.listSubs = lists;
4646
}
4747

src/main/java/javadoc/dev_utils/assist/APIReader.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,12 @@ public static String readDoc(
8484
) {
8585
// API 读取配置处理
8686
APIReader apiReader = new APIReader(classGithubUrl);
87-
apiReader.mFilterMethodMap = filterMethodMap;
88-
apiReader.mMethodNameRegex = methodNameRegex;
89-
apiReader.mMethodNameMatchesMap = methodNameMatchesMap;
90-
apiReader.mMethodRepeatBuffer = methodRepeatBuffer;
87+
apiReader.mFilterMethodMap = filterMethodMap;
88+
apiReader.mMethodNameRegex = methodNameRegex;
89+
apiReader.mMethodNameMatchesMap = methodNameMatchesMap;
90+
apiReader.mMethodRepeatBuffer = methodRepeatBuffer;
9191
apiReader.mMethodNotAnnotateBuffer = methodNotAnnotateBuffer;
92-
apiReader.mNotMethodBuffer = notMethodBuffer;
92+
apiReader.mNotMethodBuffer = notMethodBuffer;
9393
apiReader.init(); // 初始化防止为 null
9494
// 执行参数, 生成 API readAll 设置为 false, 不读取 private、protected 等修饰符方法
9595
String[] executeParams = JavaDocReader.getExecuteParams(false, path, className);

src/main/java/javadoc/dev_utils/assist/PackageCatalog.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public Catalog(
9191
File file,
9292
List<Catalog> lists
9393
) {
94-
this.file = file;
94+
this.file = file;
9595
this.listCatalogs = lists;
9696
}
9797

src/main/java/javadoc/dev_utils/check/dev/CheckInfo.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public CheckInfo(
3737
String path,
3838
ICheckConfig iCheckConfig
3939
) {
40-
this.mPath = path;
40+
this.mPath = path;
4141
this.mICheckConfig = iCheckConfig;
4242
}
4343

src/main/java/javadoc/dev_utils/check/dev/CodeAnalyzeReader.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -205,10 +205,10 @@ public String callback(
205205
if (jcModifiers != null) {
206206
// 属于接口的则跳过
207207
if (jcModifiers.toString().endsWith("interface ")) {
208-
classTag = " [interface]";
208+
classTag = " [interface]";
209209
isIgnoreClass = true;
210210
} else if (jcModifiers.toString().endsWith("abstract ")) { // 属于抽象类的跳过
211-
classTag = " [abstract]";
211+
classTag = " [abstract]";
212212
isIgnoreClass = true;
213213
}
214214
}
@@ -587,7 +587,7 @@ private static boolean subParamToCheckAnnotate(String documentation) {
587587
}
588588
} else if (isAdd) {
589589
builder.append(str + " ");
590-
isAdd = false;
590+
isAdd = false;
591591
isCheck = true;
592592
} else {
593593
isCheck = false;

0 commit comments

Comments
 (0)