diff options
-rwxr-xr-x | src/clint.py | 29 | ||||
-rw-r--r-- | src/nvim/buffer.c | 2 | ||||
-rw-r--r-- | src/nvim/change.c | 2 | ||||
-rw-r--r-- | src/nvim/eval/userfunc.c | 2 | ||||
-rw-r--r-- | src/nvim/ex_cmds.c | 2 | ||||
-rw-r--r-- | src/nvim/ex_docmd.c | 2 | ||||
-rw-r--r-- | src/nvim/ops.c | 2 | ||||
-rw-r--r-- | src/nvim/option.c | 2 | ||||
-rw-r--r-- | src/nvim/screen.c | 2 | ||||
-rw-r--r-- | src/nvim/viml/parser/expressions.c | 2 |
10 files changed, 9 insertions, 38 deletions
diff --git a/src/clint.py b/src/clint.py index cb91d9bd68..befb10c9c7 100755 --- a/src/clint.py +++ b/src/clint.py @@ -44,7 +44,6 @@ same line, but it is far from perfect (in either direction). import codecs import copy import getopt -import math # for log import os import re import sre_compile @@ -183,7 +182,6 @@ _ERROR_CATEGORIES = [ 'readability/alt_tokens', 'readability/bool', 'readability/braces', - 'readability/fn_size', 'readability/multiline_comment', 'readability/multiline_string', 'readability/nul', @@ -642,32 +640,6 @@ class _FunctionState: if self.in_a_function: self.lines_in_function += 1 - def Check(self, error, filename, linenum): - """Report if too many lines in function body. - - Args: - error: The function to call with any errors found. - filename: The name of the current file. - linenum: The number of the line to check. - """ - if Match(r'T(EST|est)', self.current_function): - base_trigger = self._TEST_TRIGGER - else: - base_trigger = self._NORMAL_TRIGGER - trigger = base_trigger * 2**_VerboseLevel() - - if self.lines_in_function > trigger: - error_level = int( - math.log(self.lines_in_function / base_trigger, 2)) - # 50 => 0, 100 => 1, 200 => 2, 400 => 3, 800 => 4, 1600 => 5, ... - if error_level > 5: - error_level = 5 - error(filename, linenum, 'readability/fn_size', error_level, - 'Small and focused functions are preferred:' - ' %s has %d non-comment lines' - ' (error triggered by exceeding %d lines).' % ( - self.current_function, self.lines_in_function, trigger)) - def End(self): """Stop analyzing function body.""" self.in_a_function = False @@ -1887,7 +1859,6 @@ def CheckForFunctionLengths(filename, clean_lines, linenum, error(filename, linenum, 'readability/fn_size', 5, 'Lint failed to find start of function body.') elif Match(r'^\}\s*$', line): # function end - function_state.Check(error, filename, linenum) function_state.End() elif not Match(r'^\s*$', line): function_state.Count() # Count non-blank/non-comment lines. diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index 1ae1811772..9759bdb46e 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -4544,7 +4544,7 @@ int build_stl_str_hl(win_T *wp, char_u *out, size_t outlen, char_u *fmt, int use } return width; -} // NOLINT(readability/fn_size) +} /// Get relative cursor position in window into "buf[buflen]", in the form 99%, /// using "Top", "Bot" or "All" when appropriate. diff --git a/src/nvim/change.c b/src/nvim/change.c index 2d5ece8880..df7a7a00a9 100644 --- a/src/nvim/change.c +++ b/src/nvim/change.c @@ -1802,7 +1802,7 @@ theend: xfree(next_line); xfree(allocated); return retval; -} // NOLINT(readability/fn_size) +} /// Delete from cursor to end of line. /// Caller must have prepared for undo. diff --git a/src/nvim/eval/userfunc.c b/src/nvim/eval/userfunc.c index 2dd022630a..c518b11a65 100644 --- a/src/nvim/eval/userfunc.c +++ b/src/nvim/eval/userfunc.c @@ -2586,7 +2586,7 @@ ret_free: if (show_block) { ui_ext_cmdline_block_leave(); } -} // NOLINT(readability/fn_size) +} /// @return 5 if "p" starts with "<SID>" or "<SNR>" (ignoring case). /// 2 if "p" starts with "s:". diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index abadd21a1a..5b831a21c0 100644 --- a/src/nvim/ex_cmds.c +++ b/src/nvim/ex_cmds.c @@ -4467,7 +4467,7 @@ skip: return preview_buf; #undef ADJUST_SUB_FIRSTLNUM #undef PUSH_PREVIEW_LINES -} // NOLINT(readability/fn_size) +} /// Give message for number of substitutions. /// Can also be used after a ":global" command. diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 116264b4c1..d2b833305b 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -2219,7 +2219,7 @@ doend: --ex_nesting_level; return ea.nextcmd; -} // NOLINT(readability/fn_size) +} static char ex_error_buf[MSG_BUF_LEN]; diff --git a/src/nvim/ops.c b/src/nvim/ops.c index 7e5840e444..f7a3201568 100644 --- a/src/nvim/ops.c +++ b/src/nvim/ops.c @@ -3761,7 +3761,7 @@ end: // If the cursor is past the end of the line put it at the end. adjust_cursor_eol(); -} // NOLINT(readability/fn_size) +} /* * When the cursor is on the NUL past the end of the line and it should not be diff --git a/src/nvim/option.c b/src/nvim/option.c index 16c4abfa2a..9be55b91b4 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -3382,7 +3382,7 @@ ambw_end: check_redraw(options[opt_idx].flags); return errmsg; -} // NOLINT(readability/fn_size) +} /// Simple int comparison function for use with qsort() static int int_cmp(const void *a, const void *b) diff --git a/src/nvim/screen.c b/src/nvim/screen.c index 384f2995ee..910cf335ca 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -1748,7 +1748,7 @@ static void win_update(win_T *wp, DecorProviders *providers) if (!got_int) { got_int = save_got_int; } -} // NOLINT(readability/fn_size) +} /// Returns width of the signcolumn that should be used for the whole window /// diff --git a/src/nvim/viml/parser/expressions.c b/src/nvim/viml/parser/expressions.c index 01fc282891..2693093f4a 100644 --- a/src/nvim/viml/parser/expressions.c +++ b/src/nvim/viml/parser/expressions.c @@ -3067,7 +3067,7 @@ viml_pexpr_parse_end: } kvi_destroy(ast_stack); return ast; -} // NOLINT(readability/fn_size) +} #undef NEW_NODE #undef HL |