diff options
author | bfredl <bjorn.linse@gmail.com> | 2022-05-07 14:21:01 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-07 14:21:01 +0200 |
commit | add3ad6a487b1ae0f07cacc24e335af8780b2243 (patch) | |
tree | fb8386e7a43e59751749c08db66dda8ddc6c2db8 /src/clint.py | |
parent | d30621064105d1f5e4e695fb09607269694f02d0 (diff) | |
parent | d0897243f6a6bb802fc9622486afd69eb65fa6d5 (diff) | |
download | rneovim-add3ad6a487b1ae0f07cacc24e335af8780b2243.tar.gz rneovim-add3ad6a487b1ae0f07cacc24e335af8780b2243.tar.bz2 rneovim-add3ad6a487b1ae0f07cacc24e335af8780b2243.zip |
Merge pull request #18450 from dundargoc/build/clint/remove-function-size-warning
build(clint): remove "function size is too large" warning
Diffstat (limited to 'src/clint.py')
-rwxr-xr-x | src/clint.py | 29 |
1 files changed, 0 insertions, 29 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. |