Skip to content

Commit

Permalink
Merge b651c65 into ae2becb
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterJCLaw committed Jul 21, 2020
2 parents ae2becb + b651c65 commit 996595b
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 13 deletions.
14 changes: 14 additions & 0 deletions .editorconfig
@@ -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
4 changes: 2 additions & 2 deletions .travis.yml
Expand Up @@ -15,7 +15,7 @@ env:
matrix:
include:
- python: 3.8
script:
script:
- 'pip install coverage'
- 'coverage run --source jedi -m pytest'
- 'coverage report'
Expand All @@ -31,7 +31,7 @@ matrix:
- 'pip install .[qa]'
script:
# 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:
- sudo apt-get -y install python3-venv
- pip install .[testing]
Expand Down
2 changes: 1 addition & 1 deletion jedi/inference/base_value.py
Expand Up @@ -111,7 +111,7 @@ def iterate(self, contextualized_node=None, is_async=False):
.py__getattribute__('__anext__').execute_with_values()
.py__getattribute__('__await__').execute_with_values()
.py__stop_iteration_returns()
) # noqa
) # noqa: E124
])
return self.py__iter__(contextualized_node)

Expand Down
6 changes: 4 additions & 2 deletions jedi/inference/gradual/annotation.py
Expand Up @@ -53,8 +53,10 @@ def _infer_annotation_string(context, string, index=None):
value_set = context.infer_node(node)
if index is not None:
value_set = value_set.filter(
lambda value: value.array_type == 'tuple' # noqa
and len(list(value.py__iter__())) >= index
lambda value: (
value.array_type == 'tuple'
and len(list(value.py__iter__())) >= index
)
).py__simple_getitem__(index)
return value_set

Expand Down
7 changes: 5 additions & 2 deletions jedi/settings.py
Expand Up @@ -69,8 +69,11 @@
# ----------------

if platform.system().lower() == 'windows':
_cache_directory = os.path.join(os.getenv('LOCALAPPDATA') or
os.path.expanduser('~'), 'Jedi', 'Jedi')
_cache_directory = os.path.join(
os.getenv('LOCALAPPDATA') or os.path.expanduser('~'),
'Jedi',
'Jedi',
)
elif platform.system().lower() == 'darwin':
_cache_directory = os.path.join('~', 'Library', 'Caches', 'Jedi')
else:
Expand Down
2 changes: 2 additions & 0 deletions setup.cfg
Expand Up @@ -13,6 +13,8 @@ ignore =
E721,
# Line break before binary operator
W503,
# Single letter loop variables are often fine
E741,
exclude = jedi/third_party/* .tox/*

[pycodestyle]
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -45,7 +45,7 @@
'Django<3.1', # For now pin this.
],
'qa': [
'flake8==3.7.9',
'flake8==3.8.3',
],
},
package_data={'jedi': ['*.pyi', 'third_party/typeshed/LICENSE',
Expand Down
7 changes: 2 additions & 5 deletions test/test_api/test_call_signatures.py
Expand Up @@ -121,11 +121,8 @@ def f(a, b):


def test_get_signatures_whitespace(Script):
s = dedent("""\
abs(
def x():
pass
""") # noqa
# note: trailing space after 'abs'
s = 'abs( \ndef x():\n pass\n'
assert_signature(Script, s, 'abs', 0, line=1, column=5)


Expand Down

0 comments on commit 996595b

Please sign in to comment.