summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Kurnikov <maxim.kurnikov@gmail.com>2019-02-26 02:21:14 +0300
committerMaxim Kurnikov <maxim.kurnikov@gmail.com>2019-02-26 23:16:20 +0300
commit3825fabc9ba74f793a43257b244fe299500e0eb0 (patch)
treefa2e0ffde8997af5c61eada58bd69ddd5b9e2af6
parent1ba36cb21f431b2c0a4b6d8fad384e46cf78767f (diff)
downloadisort-3825fabc9ba74f793a43257b244fe299500e0eb0.tar.gz
rename should_skip -> file_should_be_skipped
-rw-r--r--isort/isort.py2
-rw-r--r--isort/main.py8
-rw-r--r--isort/settings.py2
3 files changed, 6 insertions, 6 deletions
diff --git a/isort/isort.py b/isort/isort.py
index 0fd9ae82..5635133b 100644
--- a/isort/isort.py
+++ b/isort/isort.py
@@ -89,7 +89,7 @@ class SortImports(object):
self.file_path = file_path or ""
if file_path:
file_path = os.path.abspath(file_path)
- if settings.should_skip(file_path, self.config):
+ if settings.file_should_be_skipped(file_path, self.config):
self.skipped = True
if self.config['verbose']:
print("WARNING: {0} was skipped as it's listed in 'skip' setting"
diff --git a/isort/main.py b/isort/main.py
index a2d4b935..094b752c 100644
--- a/isort/main.py
+++ b/isort/main.py
@@ -28,7 +28,7 @@ from typing import Any, Dict, Iterable, Iterator, List, MutableMapping, Optional
import setuptools
from isort import SortImports, __version__
-from isort.settings import DEFAULT_SECTIONS, WrapModes, default, from_path, should_skip
+from isort.settings import DEFAULT_SECTIONS, WrapModes, default, from_path, file_should_be_skipped
INTRO = r"""
/#######################################################################\
@@ -96,7 +96,7 @@ def iter_source_code(paths: Iterable[str], config: MutableMapping[str, Any], ski
for path in paths:
if os.path.isdir(path):
- if should_skip(path, config, os.getcwd()):
+ if file_should_be_skipped(path, config, os.getcwd()):
skipped.append(path)
continue
@@ -104,13 +104,13 @@ def iter_source_code(paths: Iterable[str], config: MutableMapping[str, Any], ski
path, topdown=True, followlinks=True
):
for dirname in list(dirnames):
- if should_skip(dirname, config, dirpath):
+ if file_should_be_skipped(dirname, config, dirpath):
skipped.append(dirname)
dirnames.remove(dirname)
for filename in filenames:
filepath = os.path.join(dirpath, filename)
if is_python_file(filepath):
- if should_skip(filename, config, dirpath):
+ if file_should_be_skipped(filename, config, dirpath):
skipped.append(filename)
else:
yield filepath
diff --git a/isort/settings.py b/isort/settings.py
index 9c577556..29d36be5 100644
--- a/isort/settings.py
+++ b/isort/settings.py
@@ -363,7 +363,7 @@ def _get_config_data(file_path: str, sections: Iterable[str]) -> Dict[str, Any]:
return settings
-def should_skip(
+def file_should_be_skipped(
filename: str,
config: Mapping[str, Any],
path: str = '/'