Skip to content

Commit 50210ee

Browse files
committed
adds documentation to settings
1 parent 254e49b commit 50210ee

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

check_settings.m

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,54 @@
11
function value = check_settings(name)
2+
%CHECK_SETTINGS returns settings vor CHECK.
3+
% CHECK_SETTINGS(NAME) returns the VALUE of the settings called NAME.
4+
%
5+
% Create a local copy of this file and overwrite values if you want
6+
% custom behavior in a specific project.
7+
8+
% thresholds for the number of lines in classes:
29
settings.lo_class_num_lines = 200;
310
settings.hi_class_num_lines = 400;
11+
% thresholds for the number of properties in classes:
412
settings.lo_class_num_properties = 10;
513
settings.hi_class_num_properties = 15;
14+
% thresholds for the number of methods in classes:
615
settings.lo_class_num_methods = 10;
716
settings.hi_class_num_methods = 20;
817

18+
% thresholds for the number of lines in scripts:
919
settings.lo_script_num_lines = 100;
1020
settings.hi_script_num_lines = 200;
21+
% thresholds for the number of variables in scripts:
1122
settings.lo_script_num_variables = 10;
1223
settings.hi_script_num_variables = 20;
24+
% thresholds for the level of indentation in scripts:
1325
settings.lo_script_max_indentation = 4;
1426
settings.hi_script_max_indentation = 8;
1527

28+
% thresholds for the number of lines in functions:
1629
settings.lo_function_num_lines = 50;
1730
settings.hi_function_num_lines = 100;
31+
% thresholds for the number of arguments in functions:
1832
settings.lo_function_num_arguments = 3;
1933
settings.hi_function_num_arguments = 5;
34+
% thresholds for the number of variables in functions:
2035
settings.lo_function_num_variables = 7;
2136
settings.hi_function_num_variables = 15;
37+
% thresholds for the level of indentation in functions:
2238
settings.lo_function_max_indentation = 3;
2339
settings.hi_function_max_indentation = 6;
40+
% thresholds for the complexity of functions:
2441
settings.lo_function_complexity = 10;
2542
settings.hi_function_complexity = 15;
2643

44+
% thresholds for the line length of files:
2745
settings.lo_line_length = 75;
2846
settings.hi_line_length = 90;
2947

48+
% threshold for the variable length and spread (spread is the
49+
% number of lines in which a variable is used).
50+
% Read this as "if a variable name is less than 3 characters
51+
% long, it should be use in no more than 3 lines":
3052
settings.lo_varname_short_length = 3;
3153
settings.lo_varname_short_spread = 3;
3254
settings.lo_varname_long_length = 5;
@@ -36,6 +58,7 @@
3658
settings.hi_varname_long_length = 5;
3759
settings.hi_varname_long_spread = 15;
3860

61+
% switches to switch whole modules on or off:
3962
settings.do_check_comments = true;
4063
settings.do_check_documentation = true;
4164
settings.do_check_eval = true;
@@ -45,7 +68,10 @@
4568
settings.do_check_line_length = true;
4669
settings.do_check_indentation = true;
4770

71+
% indent by this many spaces per level of indentation:
4872
settings.indentation_step = 4;
73+
% Matlab does not indent top-level function bodies. Most other
74+
% languages would think this behavior funny:
4975
settings.indentation_check_like_matlab = true;
5076

5177
value = settings.(name);

0 commit comments

Comments
 (0)