dense-analysis / dense-analysis/ale

pylint not indexing libraries correctly

Open
#3,199 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Vim Script
Stars
14k
Forks
1.5k
Avg merge
17h 49m
Merged PRs (30d)
1

Description

## Information

**VIM version**

VIM - Vi IMproved 8.2 (2019 Dec 12, compiled May 26 2020 06:16:44)
macOS version

Operating System: macOS Catalina 10.15.5

## What went wrong

I am using anaconda as my python package manager including the default python and pylint. There are some libraries that seem to be accessible by pylint but some of its internal functions aren't. For eg: `import torch` gives no error where `torch` is an external library I installed. But `torch.device()` gives an error `[pylint] Module 'torch' has no 'device' member [E]` even though it exists!

### :ALEInfo

Current Filetype: python
Available Linters: ['bandit', 'flake8', 'mypy', 'prospector', 'pycodestyle', 'pydocstyle', 'pyflakes', 'pylama', 'pylint', 'pyls', 'pyre', 'vulture']
Enabled Linters: ['flake8', 'mypy', 'pylint']
Suggested Fixers:
'add_blank_lines_for_python_control_statements' - Add blank lines before control statements.
'autopep8' - Fix PEP8 issues with autopep8.
'black' - Fix PEP8 issues with black.
'isort' - Sort Python imports with isort.
'remove_trailing_lines' - Remove all blank lines at the end of a file.
'reorder-python-imports' - Sort Python imports with reorder-python-imports.
'trim_whitespace' - Remove all trailing whitespace characters at the end of every line.
'yapf' - Fix Python files with yapf.
Linter Variables:

let g:ale_python_auto_pipenv = 0
let g:ale_python_flake8_auto_pipenv = 0
let g:ale_python_flake8_change_directory = 1
let g:ale_python_flake8_executable = 'flake8'
let g:ale_python_flake8_options = ''
let g:ale_python_flake8_use_global = 0
let g:ale_python_mypy_auto_pipenv = 0
let g:ale_python_mypy_executable = 'mypy'
let g:ale_python_mypy_ignore_invalid_syntax = 0
let g:ale_python_mypy_options = ''
let g:ale_python_mypy_show_notes = 1
let g:ale_python_mypy_use_global = 0
let g:ale_python_pylint_auto_pipenv = 0
let g:ale_python_pylint_change_directory = 1
let g:ale_python_pylint_executable = 'pylint'
let g:ale_python_pylint_options = ''
let g:ale_python_pylint_use_global = 0
let g:ale_python_pylint_use_msg_id = 0
Global Variables:

let g:ale_cache_executable_check_failures = v:null
let g:ale_change_sign_column_color = 0
let g:ale_command_wrapper = ''
let g:ale_completion_delay = v:null
let g:ale_completion_enabled = 0
let g:ale_completion_max_suggestions = v:null
let g:ale_echo_cursor = 1
let g:ale_echo_msg_error_str = 'E'
let g:ale_echo_msg_format = '[%linter%] %s [%severity%]'
let g:ale_echo_msg_info_str = 'Info'
let g:ale_echo_msg_warning_str = 'W'
let g:ale_enabled = 1
let g:ale_fix_on_save = 0
let g:ale_fixers = {}
let g:ale_history_enabled = 1
let g:ale_history_log_output = 1
let g:ale_keep_list_window_open = 0
let g:ale_lint_delay = 200
let g:ale_lint_on_enter = 1
let g:ale_lint_on_filetype_changed = 1
let g:ale_lint_on_insert_leave = 1
let g:ale_lint_on_save = 1
let g:ale_lint_on_text_changed = 'normal'
let g:ale_linter_aliases = {}
let g:ale_linters = {}
let g:ale_linters_explicit = 0
let g:ale_list_vertical = 0
let g:ale_list_window_size = 10
let g:ale_loclist_msg_format = '[%linter%] %s [%severity%]'
let g:ale_lsp_root = {}
let g:ale_max_buffer_history_size = 20
let g:ale_max_signs = -1
let g:ale_maximum_file_size = v:null
let g:ale_open_list = 0
let g:ale_pattern_options = v:null
let g:ale_pattern_options_enabled = v:null
let g:ale_set_balloons = 1
let g:ale_set_highlights = 1
let g:ale_set_loclist = 1
let g:ale_set_quickfix = 0
let g:ale_set_signs = 1
let g:ale_sign_column_always = 0
let g:ale_sign_error = ''
let g:ale_sign_info = ''
let g:ale_sign_offset = 1000000
let g:ale_sign_style_error = ''
let g:ale_sign_style_warning = ''
let g:ale_sign_warning = ''
let g:ale_sign_highlight_linenrs = 0
let g:ale_statusline_format = v:null
let g:ale_type_map = {}
let g:ale_use_global_executables = v:null
let g:ale_virtualtext_cursor = 0
let g:ale_warn_about_trailing_blank_lines = 1
let g:ale_warn_about_trailing_whitespace = 1
Command History:

(executable check - failure) flake8
(executable check - failure) mypy
(executable check - success) pylint
(finished - exit code 30) ['/usr/local/bin/bash', '-c', 'cd ''/Users/abhinav/Documents/RL/l2c/refgame'' && ''pylint'' --output-format text --msg-template="{path}:{line}:{column}: {msg_id} ({symbol}) {msg}" --reports n ''/Users/abhinav/Documents/RL/l2c/refgame/models_refgame.py''']

<<>>
************* Module models_refgame
models_refgame.py:75:0: C0301 (line-too-long) Line too long (133/100)
models_refgame.py:76:0: C0301 (line-too-long) Line too long (111/100)
models_refgame.py:99:0: C0301 (line-too-long) Line too long (103/100)
models_refgame.py:143:0: C0301 (line-too-long) Line too long (105/100)
models_refgame.py:151:0: C0301 (line-too-long) Line too long (101/100)
models_refgame.py:217:0: C0301 (line-too-long) Line too long (106/100)
models_refgame.py:236:0: C0301 (line-too-long) Line too long (120/100)
models_refgame.py:253:0: C0301 (line-too-long) Line too long (113/100)
models_refgame.py:362:0: C0301 (line-too-long) Line too long (105/100)
models_refgame.py:370:0: C0301 (line-too-long) Line too long (101/100)
models_refgame.py:414:0: C0301 (line-too-long) Line too long (101/100)
models_refgame.py:438:0: C0301 (line-too-long) Line too long (126/100)
models_refgame.py:439:0: C0330 (bad-continuation) Wrong continued indentation (add 10 spaces).
seed_val_data['spk_msgs'], seed_val_data['spk_msg_lens'])
^ |
models_refgame.py:439:0: C0301 (line-too-long) Line too long (113/100)
models_refgame.py:440:0: C0301 (line-too-long) Line too long (106/100)
models_refgame.py:441:0: C0301 (line-too-long) Line too long (103/100)
models_refgame.py:454:0: C0330 (bad-continuation) Wrong continued indentation (remove 13 spaces).
train_spk_msg_lens)
| ^
models_refgame.py:460:0: C0301 (line-too-long) Line too long (116/100)
models_refgame.py:461:0: C0330 (bad-continuation) Wrong continued indentation (add 9 spaces).
seed_val_data['spk_msgs'], seed_val_data['spk_msg_lens'])
^ |
models_refgame.py:461:0: C0301 (line-too-long) Line too long (104/100)
models_refgame.py:465:0: C0301 (line-too-long) Line too long (115/100)
models_refgame.py:477:0: C0301 (line-too-long) Line too long (114/100)
models_refgame.py:501:0: C0301 (line-too-long) Line too long (110/100)
models_refgame.py:502:0: C0330 (bad-continuation) Wrong continued indentation (add 14 spaces).
val_spk_msgs, val_spk_msg_lens)
^ |
models_refgame.py:514:0: C0301 (line-too-long) Line too long (102/100)
models_refgame.py:551:0: C0301 (line-too-long) Line too long (117/100)
models_refgame.py:560:0: C0301 (line-too-long) Line too long (116/100)
models_refgame.py:563:0: C0301 (line-too-long) Line too long (116/100)
models_refgame.py:568:0: C0301 (line-too-long) Line too long (106/100)
models_refgame.py:576:0: C0301 (line-too-long) Line too long (108/100)
models_refgame.py:610:0: C0301 (line-too-long) Line too long (117/100)
models_refgame.py:623:0: C0301 (line-too-long) Line too long (116/100)
models_refgame.py:626:0: C0301 (line-too-long) Line too long (116/100)
models_refgame.py:635:0: C0301 (line-too-long) Line too long (106/100)
models_refgame.py:1:0: C0114 (missing-module-docstring) Missing module docstring
models_refgame.py:16:0: W0401 (wildcard-import) Wildcard import util_refgame
models_refgame.py:20:4: C0103 (invalid-name) Constant name "device" doesn't conform to UPPER_CASE naming style
models_refgame.py:20:13: E1101 (no-member) Module 'torch' has no 'device' member
models_refgame.py:22:4: C0103 (invalid-name) Constant name "device" doesn't conform to UPPER_CASE naming style
models_refgame.py:22:13: E1101 (no-member) Module 'torch' has no 'device' member
models_refgame.py:25:0: C0116 (missing-function-docstring) Missing function or method docstring
models_refgame.py:26:4: C0103 (invalid-name) Variable name "U" doesn't conform to snake_case naming style
models_refgame.py:26:8: E1101 (no-member) Module 'torch' has no 'empty' member
models_refgame.py:27:12: E1101 (no-member) Module 'torch' has no 'log' member
models_refgame.py:27:23: E1101 (no-member) Module 'torch' has no 'log' member
models_refgame.py:30:0: C0116 (missing-function-docstring) Missing function or method docstring
models_refgame.py:31:4: C0103 (invalid-name) Variable name "y" doesn't conform to snake_case naming style
models_refgame.py:35:0: C0116 (missing-function-docstring) Missing function or method docstring
models_refgame.py:36:4: C0103 (invalid-name) Variable name "y" doesn't conform to snake_case naming style
models_refgame.py:37:23: E1101 (no-member) Module 'torch' has no 'max' member
models_refgame.py:39:17: E1101 (no-member) Module 'torch' has no 'zeros' member
models_refgame.py:40:8: C0103 (invalid-name) Variable name "y" doesn't conform to snake_case naming style
models_refgame.py:37:4: W0612 (unused-variable) Unused variable 'y_max'
models_refgame.py:45:0: C0115 (missing-class-docstring) Missing class docstring
models_refgame.py:55:4: W0221 (arguments-differ) Parameters differ from overridden 'forward' method
models_refgame.py:80:8: C0103 (invalid-name) Attribute name "D_hid" doesn't conform to snake_case naming style
models_refgame.py:81:8: C0103 (invalid-name) Attribute name "D_emb" doesn't conform to snake_case naming style
models_refgame.py:70:0: C0115 (missing-class-docstring) Missing class docstring
models_refgame.py:70:0: R0902 (too-many-instance-attributes) Too many instance attributes (16/7)
models_refgame.py:94:4: W0221 (arguments-differ) Parameters differ from overridden 'forward' method
models_refgame.py:99:14: E1101 (no-member) Module 'torch' has no 'zeros' member
models_refgame.py:125:4: C0116 (missing-function-docstring) Missing function or method docstring
models_refgame.py:125:4: R0914 (too-many-locals) Too many local variables (19/15)
models_refgame.py:129:39: E1101 (no-member) Module 'torch' has no 'sort' member
models_refgame.py:140:12: C0103 (invalid-name) Variable name "c" doesn't conform to snake_case naming style
models_refgame.py:143:21: E1102 (not-callable) torch.tensor is not callable
models_refgame.py:143:79: E1101 (no-member) Module 'torch' has no 'long' member
models_refgame.py:146:16: E1101 (no-member) Module 'torch' has no 'stack' member
models_refgame.py:151:21: E1101 (no-member) Module 'torch' has no 'mean' member
models_refgame.py:151:32: E1101 (no-member) Module 'torch' has no 'pow' member
models_refgame.py:153:20: E1101 (no-member) Module 'torch' has no 'argmax' member
models_refgame.py:160:4: C0116 (missing-function-docstring) Missing function or method docstring
models_refgame.py:165:4: C0116 (missing-function-docstring) Missing function or method docstring
models_refgame.py:188:8: C0103 (invalid-name) Attribute name "D_emb" doesn't conform to snake_case naming style
models_refgame.py:189:8: C0103 (invalid-name) Attribute name "D_hid" doesn't conform to snake_case naming style
models_refgame.py:175:0: R0902 (too-many-instance-attributes) Too many instance attributes (17/7)
models_refgame.py:218:8: W0622 (redefined-builtin) Redefining built-in 'input'
models_refgame.py:204:4: W0221 (arguments-differ) Parameters differ from overridden 'forward' method
models_refgame.py:204:4: R0914 (too-many-locals) Too many local variables (16/15)
models_refgame.py:217:8: C0103 (invalid-name) Variable name "ft" doesn't conform to snake_case naming style
models_refgame.py:217:13: E1102 (not-callable) torch.tensor is not callable
models_refgame.py:217:39: E1101 (no-member) Module 'torch' has no 'long' member
models_refgame.py:232:16: C0103 (invalid-name) Variable name "ii" doesn't conform to snake_case naming style
models_refgame.py:242:18: E1101 (no-member) Module 'torch' has no 'stack' member
models_refgame.py:243:19: E1102 (not-callable) torch.tensor is not callable
models_refgame.py:243:48: E1101 (no-member) Module 'torch' has no 'long' member
models_refgame.py:251:4: C0116 (missing-function-docstring) Missing function or method docstring
models_refgame.py:251:4: R0914 (too-many-locals) Too many local variables (19/15)
models_refgame.py:253:16: E1101 (no-member) Module 'torch' has no 'arange' member
models_refgame.py:284:4: C0116 (missing-function-docstring) Missing function or method docstring
models_refgame.py:289:4: C0116 (missing-function-docstring) Missing function or method docstring
models_refgame.py:330:8: C0103 (invalid-name) Attribute name "D_hid" doesn't conform to snake_case naming style
models_refgame.py:299:0: R0902 (too-many-instance-attributes) Too many instance attributes (10/7)
models_refgame.py:334:4: W0221 (arguments-differ) Parameters differ from overridden 'forward' method
models_refgame.py:341:35: E1101 (no-member) Module 'torch' has no 'sort' member
models_refgame.py:349:4: C0116 (missing-function-docstring) Missing function or method docstring
models_refgame.py:349:4: R0914 (too-many-locals) Too many local variables (17/15)
models_refgame.py:359:12: C0103 (invalid-name) Variable name "c" doesn't conform to snake_case naming style
models_refgame.py:362:21: E1102 (not-callable) torch.tensor is not callable
models_refgame.py:362:79: E1101 (no-member) Module 'torch' has no 'long' member
models_refgame.py:365:16: E1101 (no-member) Module 'torch' has no 'stack' member
models_refgame.py:370:21: E1101 (no-member) Module 'torch' has no 'mean' member
models_refgame.py:370:32: E1101 (no-member) Module 'torch' has no 'pow' member
models_refgame.py:372:20: E1101 (no-member) Module 'torch' has no 'argmax' member
models_refgame.py:380:4: C0116 (missing-function-docstring) Missing function or method docstring
models_refgame.py:385:4: E0102 (function-redefined) method already defined line 380
models_refgame.py:385:4: C0116 (missing-function-docstring) Missing function or method docstring
models_refgame.py:395:0: C0115 (missing-class-docstring) Missing class docstring
models_refgame.py:395:0: W0223 (abstract-method) Method 'forward' is abstract in class 'Module' but is not overridden
models_refgame.py:395:0: R0902 (too-many-instance-attributes) Too many instance attributes (10/7)
models_refgame.py:413:4: C0116 (missing-function-docstring) Missing function or method docstring
models_refgame.py:417:4: C0116 (missing-function-docstring) Missing function or method docstring
models_refgame.py:417:4: R0914 (too-many-locals) Too many local variables (28/15)
models_refgame.py:438:8: W0612 (unused-variable) Unused variable 'before_seed_val_loss'
models_refgame.py:440:8: W0612 (unused-variable) Unused variable 'before_val_loss'
models_refgame.py:460:12: W0612 (unused-variable) Unused variable 'seed_val_loss'
models_refgame.py:479:4: C0116 (missing-function-docstring) Missing function or method docstring
models_refgame.py:479:4: R0914 (too-many-locals) Too many local variables (28/15)
models_refgame.py:501:12: W0612 (unused-variable) Unused variable 'before_val_loss'
models_refgame.py:506:16: W0612 (unused-variable) Unused variable 'j'
models_refgame.py:521:16: W0612 (unused-variable) Unused variable 'val_loss'
models_refgame.py:544:0: C0115 (missing-class-docstring) Missing class docstring
models_refgame.py:544:0: W0223 (abstract-method) Method 'forward' is abstract in class 'Module' but is not overridden
models_refgame.py:546:4: W0235 (useless-super-delegation) Useless super delegation in method '__init__'
models_refgame.py:549:4: C0116 (missing-function-docstring) Missing function or method docstring
models_refgame.py:549:4: R0913 (too-many-arguments) Too many arguments (6/5)
models_refgame.py:549:4: R0914 (too-many-locals) Too many local variables (25/15)
models_refgame.py:580:19: C0103 (invalid-name) Variable name "g" doesn't conform to snake_case naming style
models_refgame.py:587:8: C0200 (consider-using-enumerate) Consider using enumerate instead of iterating with range and len
models_refgame.py:588:21: E1101 (no-member) Module 'torch' has no 'mean' member
models_refgame.py:588:32: E1101 (no-member) Module 'torch' has no 'stack' member
models_refgame.py:549:70: W0613 (unused-argument) Unused argument 'pretrain'
models_refgame.py:568:25: W0612 (unused-variable) Unused variable 'in_acc'
models_refgame.py:576:22: W0612 (unused-variable) Unused variable 'out_acc'
models_refgame.py:603:0: C0115 (missing-class-docstring) Missing class docstring
models_refgame.py:603:0: W0223 (abstract-method) Method 'forward' is abstract in class 'Module' but is not overridden
models_refgame.py:605:4: W0235 (useless-super-delegation) Useless super delegation in method '__init__'
models_refgame.py:608:4: C0116 (missing-function-docstring) Missing function or method docstring
models_refgame.py:608:4: R0913 (too-many-arguments) Too many arguments (6/5)
models_refgame.py:608:4: R0914 (too-many-locals) Too many local variables (19/15)
models_refgame.py:653:8: C0200 (consider-using-enumerate) Consider using enumerate instead of iterating with range and len
models_refgame.py:654:21: E1101 (no-member) Module 'torch' has no 'mean' member
models_refgame.py:654:32: E1101 (no-member) Module 'torch' has no 'stack' member
models_refgame.py:635:25: W0612 (unused-variable) Unused variable 'in_acc'
models_refgame.py:1:0: W0611 (unused-import) Unused import operator
models_refgame.py:2:0: W0611 (unused-import) Unused import math
models_refgame.py:3:0: W0611 (unused-import) Unused import sys
models_refgame.py:4:0: W0611 (unused-import) Unused import os
models_refgame.py:5:0: W0611 (unused-import) Unused import time
models_refgame.py:6:0: W0611 (unused-import) Unused import pickle
models_refgame.py:14:0: W0611 (unused-import) Unused torch.distributions imported as dists
models_refgame.py:16:0: W0614 (unused-wildcard-import) Unused import argparse from wildcard import
models_refgame.py:16:0: W0614 (unused-wildcard-import) Unused import itertools from wildcard import
models_refgame.py:16:0: W0614 (unused-wildcard-import) Unused import plt from wildcard import
models_refgame.py:16:0: W0614 (unused-wildcard-import) Unused import get_s2p_batch from wildcard import
models_refgame.py:16:0: W0614 (unused-wildcard-import) Unused import get_batch_with_speaker from wildcard import
models_refgame.py:16:0: W0614 (unused-wildcard-import) Unused import get_l2c_batch from wildcard import
models_refgame.py:16:0: W0614 (unused-wildcard-import) Unused import trim_caps from wildcard import
models_refgame.py:16:0: W0614 (unused-wildcard-import) Unused import truncate_dicts from wildcard import
models_refgame.py:16:0: W0614 (unused-wildcard-import) Unused import truncate_captions from wildcard import
models_refgame.py:16:0: W0614 (unused-wildcard-import) Unused import load_model from wildcard import
models_refgame.py:16:0: W0614 (unused-wildcard-import) Unused import save_to_file from wildcard import
models_refgame.py:16:0: W0614 (unused-wildcard-import) Unused import torch_save_to_file from wildcard import
models_refgame.py:16:0: W0614 (unused-wildcard-import) Unused import to_sentence from wildcard import
models_refgame.py:16:0: W0614 (unused-wildcard-import) Unused import str2bool from wildcard import
models_refgame.py:16:0: W0614 (unused-wildcard-import) Unused import filter_caps from wildcard import
models_refgame.py:16:0: W0614 (unused-wildcard-import) Unused import plot_grad_flow from wildcard import
models_refgame.py:16:0: W0614 (unused-wildcard-import) Unused import OrderedDict from wildcard import
models_refgame.py:8:0: C0411 (wrong-import-order) standard import "import random" should be placed before "import numpy as np"

------------------------------------------------------------------
Your code has been rated at 2.57/10 (previous run: 2.57/10, +0.00)

<<>>

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.