Skip to content

Commit

Permalink
Fix mypy and coveralls
Browse files Browse the repository at this point in the history
  • Loading branch information
gerardroche committed Jan 22, 2020
1 parent 29c56e7 commit 490beb9
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 4 deletions.
6 changes: 5 additions & 1 deletion .travis.yml
Expand Up @@ -33,7 +33,7 @@ install:
pip install flake8==3.5;
pip install flake8-docstrings;
pip install pydocstyle==3.0.0;
pip install python-coveralls;
pip install python-coveralls==2.8.0;
pip install mypy==0.540;
flake8 --version;
mypy --version;
Expand All @@ -55,6 +55,10 @@ script:
- sh travis.sh run_syntax_tests
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then
flake8;
cd "$HOME/.config/sublime-text-3/Packages/$PACKAGE/";
find . -type d ! -path "*/\.*" ! -path "./tmp*" ! -path "./htmlcov*" ! -path "./bin*" ! -path "./res*" ! -path "./tests/fixtures*" ! -exec test -f "{}/__init__.pyi" ";" ! -exec test -f "{}/__init__.py" ";" -exec touch "{}/__init__.pyi" ";" -print;
find . -type f -name __init__.py -print;
find . -type f -name __init__.pyi -print;
if [ "$TRAVIS_PYTHON_VERSION" == "3.3" ]; then
mypy ../PHPUnitKit || true;
else
Expand Down
21 changes: 21 additions & 0 deletions mypy.ini
@@ -0,0 +1,21 @@
[mypy]
check_untyped_defs = True
ignore_missing_imports = False
incremental = True
no_implicit_reexport = True
show_column_numbers = True
strict_equality = True
strict_optional = True
verbosity = 0

disallow_any_unimported = True
disallow_subclassing_any = True
disallow_untyped_decorators = False

warn_no_return = True
warn_redundant_casts = True
warn_unused_configs = True
warn_unused_ignores = True

[mypy-*.tests.*]
ignore_errors = True
6 changes: 3 additions & 3 deletions plugin.py
Expand Up @@ -90,7 +90,7 @@ def find_phpunit_configuration_file(file_name, folders):
if not len(folders) > 0:
return None

ancestor_folders = []
ancestor_folders = [] # type: list
common_prefix = os.path.commonprefix(folders)
parent = os.path.dirname(file_name)
while parent not in ancestor_folders and parent.startswith(common_prefix):
Expand Down Expand Up @@ -322,7 +322,7 @@ def find_switchable(view, on_select=None):

debug_message('file contains %s class %s', len(classes), classes)

locations = []
locations = [] # type: list
for _class in classes:
class_name = _class['class']

Expand All @@ -338,7 +338,7 @@ def find_switchable(view, on_select=None):

def unique_locations(locations):
locs = []
seen = set()
seen = set() # type: set
for location in locations:
if location[0] not in seen:
seen.add(location[0])
Expand Down

0 comments on commit 490beb9

Please sign in to comment.