diff options
author | Peter Kolbus <peter.kolbus@gmail.com> | 2020-11-29 07:57:39 -0600 |
---|---|---|
committer | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2021-03-09 09:13:05 +0100 |
commit | d19c7733717ae9ad0a527233c2950473dce3ffcf (patch) | |
tree | 4215a2523554d2230ce1276da867e27d45a2308c /pylint/utils/utils.py | |
parent | 0f1245c2959f16dd68a2f7cf191c3cee0fcc08c2 (diff) | |
download | pylint-git-d19c7733717ae9ad0a527233c2950473dce3ffcf.tar.gz |
Reduce 'blacklist' term for ignored files
Replace usage of the term 'blacklist' in the context of ignored files
and directories (--ignore and --ignore-patterns), except in cases where
backward compatibility is needed. In documentation and help, supplement
'ignore' with 'skip'; in code use the term 'ignore list'.
Diffstat (limited to 'pylint/utils/utils.py')
-rw-r--r-- | pylint/utils/utils.py | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/pylint/utils/utils.py b/pylint/utils/utils.py index 35a74bfcd..0b4351722 100644 --- a/pylint/utils/utils.py +++ b/pylint/utils/utils.py @@ -97,17 +97,17 @@ def tokenize_module(module): return list(tokenize.tokenize(readline)) -def _basename_in_blacklist_re(base_name, black_list_re): - """Determines if the basename is matched in a regex blacklist +def _basename_in_ignore_list_re(base_name, ignore_list_re): + """Determines if the basename is matched in a regex ignorelist :param str base_name: The basename of the file - :param list black_list_re: A collection of regex patterns to match against. - Successful matches are blacklisted. + :param list ignore_list_re: A collection of regex patterns to match against. + Successful matches are ignored. - :returns: `True` if the basename is blacklisted, `False` otherwise. + :returns: `True` if the basename is ignored, `False` otherwise. :rtype: bool """ - for file_pattern in black_list_re: + for file_pattern in ignore_list_re: if file_pattern.match(base_name): return True return False @@ -136,7 +136,7 @@ def get_python_path(filepath): return None -def expand_modules(files_or_modules, black_list, black_list_re): +def expand_modules(files_or_modules, ignore_list, ignore_list_re): """take a list of files/modules/packages and return the list of tuple (file, module name) which have to be actually checked """ @@ -145,9 +145,9 @@ def expand_modules(files_or_modules, black_list, black_list_re): path = sys.path.copy() for something in files_or_modules: - if os.path.basename(something) in black_list: + if os.path.basename(something) in ignore_list: continue - if _basename_in_blacklist_re(os.path.basename(something), black_list_re): + if _basename_in_ignore_list_re(os.path.basename(something), ignore_list_re): continue module_path = get_python_path(something) @@ -211,12 +211,12 @@ def expand_modules(files_or_modules, black_list, black_list_re): ) if has_init or is_namespace or is_directory: for subfilepath in modutils.get_module_files( - os.path.dirname(filepath), black_list, list_all=is_namespace + os.path.dirname(filepath), ignore_list, list_all=is_namespace ): if filepath == subfilepath: continue - if _basename_in_blacklist_re( - os.path.basename(subfilepath), black_list_re + if _basename_in_ignore_list_re( + os.path.basename(subfilepath), ignore_list_re ): continue |