forked from VimPlug/jedi
Merge branch 'master' of github.com:davidhalter/jedi
This commit is contained in:
@@ -0,0 +1,14 @@
|
|||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
charset = utf-8
|
||||||
|
end_of_line = lf
|
||||||
|
indent_style = space
|
||||||
|
insert_final_newline = true
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
|
||||||
|
[*.py]
|
||||||
|
indent_size = 4
|
||||||
|
|
||||||
|
[*.md]
|
||||||
|
indent_size = 2
|
||||||
+2
-2
@@ -15,7 +15,7 @@ env:
|
|||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- python: 3.8
|
- python: 3.8
|
||||||
script:
|
script:
|
||||||
- 'pip install coverage'
|
- 'pip install coverage'
|
||||||
- 'coverage run --source jedi -m pytest'
|
- 'coverage run --source jedi -m pytest'
|
||||||
- 'coverage report'
|
- 'coverage report'
|
||||||
@@ -31,7 +31,7 @@ matrix:
|
|||||||
- 'pip install .[qa]'
|
- 'pip install .[qa]'
|
||||||
script:
|
script:
|
||||||
# Ignore F401, which are unused imports. flake8 is a primitive tool and is sometimes wrong.
|
# Ignore F401, which are unused imports. flake8 is a primitive tool and is sometimes wrong.
|
||||||
- 'flake8 --extend-ignore F401 {posargs:jedi}'
|
- 'flake8 --extend-ignore F401 jedi setup.py'
|
||||||
install:
|
install:
|
||||||
- sudo apt-get -y install python3-venv
|
- sudo apt-get -y install python3-venv
|
||||||
- pip install .[testing]
|
- pip install .[testing]
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ class HelperValueMixin(object):
|
|||||||
.py__getattribute__('__anext__').execute_with_values()
|
.py__getattribute__('__anext__').execute_with_values()
|
||||||
.py__getattribute__('__await__').execute_with_values()
|
.py__getattribute__('__await__').execute_with_values()
|
||||||
.py__stop_iteration_returns()
|
.py__stop_iteration_returns()
|
||||||
) # noqa
|
) # noqa: E124
|
||||||
])
|
])
|
||||||
return self.py__iter__(contextualized_node)
|
return self.py__iter__(contextualized_node)
|
||||||
|
|
||||||
|
|||||||
@@ -53,8 +53,10 @@ def _infer_annotation_string(context, string, index=None):
|
|||||||
value_set = context.infer_node(node)
|
value_set = context.infer_node(node)
|
||||||
if index is not None:
|
if index is not None:
|
||||||
value_set = value_set.filter(
|
value_set = value_set.filter(
|
||||||
lambda value: value.array_type == 'tuple' # noqa
|
lambda value: (
|
||||||
and len(list(value.py__iter__())) >= index
|
value.array_type == 'tuple'
|
||||||
|
and len(list(value.py__iter__())) >= index
|
||||||
|
)
|
||||||
).py__simple_getitem__(index)
|
).py__simple_getitem__(index)
|
||||||
return value_set
|
return value_set
|
||||||
|
|
||||||
|
|||||||
+5
-2
@@ -69,8 +69,11 @@ Adds an opening bracket after a function for completions.
|
|||||||
# ----------------
|
# ----------------
|
||||||
|
|
||||||
if platform.system().lower() == 'windows':
|
if platform.system().lower() == 'windows':
|
||||||
_cache_directory = os.path.join(os.getenv('LOCALAPPDATA') or
|
_cache_directory = os.path.join(
|
||||||
os.path.expanduser('~'), 'Jedi', 'Jedi')
|
os.getenv('LOCALAPPDATA') or os.path.expanduser('~'),
|
||||||
|
'Jedi',
|
||||||
|
'Jedi',
|
||||||
|
)
|
||||||
elif platform.system().lower() == 'darwin':
|
elif platform.system().lower() == 'darwin':
|
||||||
_cache_directory = os.path.join('~', 'Library', 'Caches', 'Jedi')
|
_cache_directory = os.path.join('~', 'Library', 'Caches', 'Jedi')
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ ignore =
|
|||||||
E721,
|
E721,
|
||||||
# Line break before binary operator
|
# Line break before binary operator
|
||||||
W503,
|
W503,
|
||||||
|
# Single letter loop variables are often fine
|
||||||
|
E741,
|
||||||
exclude = jedi/third_party/* .tox/*
|
exclude = jedi/third_party/* .tox/*
|
||||||
|
|
||||||
[pycodestyle]
|
[pycodestyle]
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ setup(name='jedi',
|
|||||||
'Django<3.1', # For now pin this.
|
'Django<3.1', # For now pin this.
|
||||||
],
|
],
|
||||||
'qa': [
|
'qa': [
|
||||||
'flake8==3.7.9',
|
'flake8==3.8.3',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
package_data={'jedi': ['*.pyi', 'third_party/typeshed/LICENSE',
|
package_data={'jedi': ['*.pyi', 'third_party/typeshed/LICENSE',
|
||||||
|
|||||||
@@ -121,11 +121,8 @@ def test_multiple_signatures(Script):
|
|||||||
|
|
||||||
|
|
||||||
def test_get_signatures_whitespace(Script):
|
def test_get_signatures_whitespace(Script):
|
||||||
s = dedent("""\
|
# note: trailing space after 'abs'
|
||||||
abs(
|
s = 'abs( \ndef x():\n pass\n'
|
||||||
def x():
|
|
||||||
pass
|
|
||||||
""") # noqa
|
|
||||||
assert_signature(Script, s, 'abs', 0, line=1, column=5)
|
assert_signature(Script, s, 'abs', 0, line=1, column=5)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user