mmshivesh / Python-Nova.novaextension

Python Extension for Panic's Nova editor for macOS
https://extensions.panic.com/extensions/works.creativecode/works.creativecode.python-nova/
22 stars 6 forks source link

Settings for PyCodeStyle (and maybe PyDocStyle) aren't working #6

Open Gugu7264 opened 4 years ago

Gugu7264 commented 4 years ago

I currently enabled everything I could in the extension, and I also have these settings: Capture d’écran 2020-11-01 à 18 36 09 However, even after restarting the extension by unchecking and checking again the box on the extensions menu, I get this in the issues panel: Capture d’écran 2020-11-01 à 18 36 13

That would be good if this can be fixed, thanks!

Gugu7264 commented 4 years ago

After some self investigations, here's what I could find in extensions console: From "Python":

Python[18:44:58.668000] pyls.executable: /Library/Frameworks/Python.framework/Versions/3.8/bin/pyls

Python[18:44:58.668000] pyls.logPath: /private/tmp/pyls.log

Python[18:44:58.684000] pyls.configurationSources: pycodestyle

Python[18:44:58.684000] pyls.rope.extensionModules: null is null. Returning undefined

Python[18:44:58.684000] pyls.rope.ropeFolder: null is null. Returning undefined

Python[18:44:58.685000] pyls.plugins.jedi.enabled: true

Python[18:44:58.685000] pyls.plugins.jedi.extra_paths: null is null. Returning undefined

Python[18:44:58.685000] pyls.plugins.jedi.env_vars: null is null. Returning undefined

Python[18:44:58.685000] pyls.plugins.jedi.environment: null is null. Returning undefined

Python[18:44:58.686000] pyls.plugins.jedi_completion.enabled: true

Python[18:44:58.686000] pyls.plugins.jedi_completion.fuzzy: true

Python[18:44:58.686000] pyls.plugins.jedi_completion.include_params: true

Python[18:44:58.686000] pyls.plugins.jedi_completion.include_class_objects: true

Python[18:44:58.686000] pyls.plugins.jedi_definition.enabled: true

Python[18:44:58.687000] pyls.plugins.jedi_definition.follow_imports: true

Python[18:44:58.687000] pyls.plugins.jedi_definition.follow_builtin_imports: true

Python[18:44:58.687000] pyls.plugins.jedi_hover.enabled: true

Python[18:44:58.687000] pyls.plugins.jedi_references.enabled: true

Python[18:44:58.687000] pyls.plugins.jedi_signature_help.enabled: true

Python[18:44:58.688000] pyls.plugins.jedi_symbols.enabled: true

Python[18:44:58.688000] pyls.plugins.jedi_symbols.all_scopes: true

Python[18:44:58.688000] pyls.plugins.mccabe.enabled: true

Python[18:44:58.688000] pyls.plugins.mccabe.threshold: 15

Python[18:44:58.688000] pyls.plugins.preload.enabled: true

Python[18:44:58.688000] pyls.plugins.preload.modules: null is null. Returning undefined

Python[18:44:58.689000] pyls.plugins.pycodestyle.enabled: true

Python[18:44:58.689000] pyls.plugins.pycodestyle.exclude: null is null. Returning undefined

Python[18:44:58.689000] pyls.plugins.pycodestyle.filename: null is null. Returning undefined

Python[18:44:58.689000] pyls.plugins.pycodestyle.select: null is null. Returning undefined

Python[18:44:58.689000] pyls.plugins.pycodestyle.ignore: E501,E402

Python[18:44:58.690000] pyls.plugins.pycodestyle.hangClosing: true

Python[18:44:58.690000] pyls.plugins.pycodestyle.maxLineLength: 10000

Python[18:44:58.690000] pyls.plugins.pydocstyle.enabled: true

Python[18:44:58.691000] pyls.plugins.pydocstyle.convention: numpy

Python[18:44:58.691000] pyls.plugins.pydocstyle.addIgnore: D100,D101,D102,D103

Python[18:44:58.691000] pyls.plugins.pydocstyle.addSelect: null is null. Returning undefined

Python[18:44:58.691000] pyls.plugins.pydocstyle.ignore: null is null. Returning undefined

Python[18:44:58.691000] pyls.plugins.pydocstyle.select: null is null. Returning undefined

Python[18:44:58.692000] pyls.plugins.pydocstyle.match: (?!test_).*\.py

Python[18:44:58.692000] pyls.plugins.pydocstyle.matchDir: [^\.].*

Python[18:44:58.692000] pyls.plugins.pylint.enabled: true

Python[18:44:58.692000] pyls.plugins.pylint.args: --enable=all

Python[18:44:58.692000] pyls.plugins.pylint.executable: /Users/XXXXX/Library/Python/3.8/bin/pylint

Python[18:44:58.692000] pyls.plugins.rope_completion.enabled: true

Python[18:44:58.693000] pyls.plugins.pyflakes.enabled: true

Python[18:44:58.693000] pyls.plugins.pylint.enabled: true

Python[18:44:58.693000] pyls.plugins.yapf.enabled: true

Python[18:44:58.693000] pyls.plugins.pydocstyle.enabled: true

Python[18:44:58.693000] pyls.plugins.pyls_mypy.enabled: true

Python[18:44:58.693000] pyls.plugins.pyls_mypy.live_mode: true

Python[18:44:58.693000] pyls.plugins.pyls_black.enabled: true

Python[18:44:58.694000] pyls.plugins.pyls_isort.enabled: true

From "Python Language Server":

Python Language Server[18:45:00.345000] Exception in thread Thread-1:

Python Language Server[18:45:00.345000] Traceback (most recent call last):

Python Language Server[18:45:00.345000]   File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/threading.py", line 932, in _bootstrap_inner

Python Language Server[18:45:00.345000]     self.run()

Python Language Server[18:45:00.345000]   File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/threading.py", line 1254, in run

Python Language Server[18:45:00.345000]     self.function(*self.args, **self.kwargs)

Python Language Server[18:45:00.345000]   File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pyls/_utils.py", line 36, in run

Python Language Server[18:45:00.345000]     return func(*args, **kwargs)

Python Language Server[18:45:00.345000]   File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pyls/python_ls.py", line 274, in lint

Python Language Server[18:45:00.345000]     flatten(self._hook('pyls_lint', doc_uri, is_saved=is_saved))

Python Language Server[18:45:00.345000]   File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pyls/python_ls.py", line 156, in _hook

Python Language Server[18:45:00.345000]     return hook_handlers(config=self.config, workspace=workspace, document=doc, **kwargs)

Python Language Server[18:45:00.345000]   File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pluggy/hooks.py", line 286, in __call__

Python Language Server[18:45:00.345000]     return self._hookexec(self, self.get_hookimpls(), kwargs)

Python Language Server[18:45:00.345000]   File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pluggy/manager.py", line 93, in _hookexec

Python Language Server[18:45:00.345000]     return self._inner_hookexec(hook, methods, kwargs)

Python Language Server[18:45:00.345000]   File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pluggy/manager.py", line 337, in traced_hookexec

Python Language Server[18:45:00.345000]     return outcome.get_result()

Python Language Server[18:45:00.345000]   File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pluggy/callers.py", line 80, in get_result

Python Language Server[18:45:00.345000]     raise ex[1].with_traceback(ex[2])

Python Language Server[18:45:00.345000]   File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pluggy/callers.py", line 52, in from_call

Python Language Server[18:45:00.345000]     result = func()

Python Language Server[18:45:00.345000]   File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pluggy/manager.py", line 335, in <lambda>

Python Language Server[18:45:00.345000]     outcome = _Result.from_call(lambda: oldcall(hook, hook_impls, kwargs))

Python Language Server[18:45:00.345000]   File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pluggy/manager.py", line 84, in <lambda>

Python Language Server[18:45:00.345000]     self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(

Python Language Server[18:45:00.345000]   File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pluggy/callers.py", line 208, in _multicall

Python Language Server[18:45:00.345000]     return outcome.get_result()

Python Language Server[18:45:00.345000]   File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pluggy/callers.py", line 80, in get_result

Python Language Server[18:45:00.345000]     raise ex[1].with_traceback(ex[2])

Python Language Server[18:45:00.345000]   File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pluggy/callers.py", line 187, in _multicall

Python Language Server[18:45:00.345000]     res = hook_impl.function(*args)

Python Language Server[18:45:00.345000]   File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pyls/plugins/pylint_lint.py", line 179, in pyls_lint

Python Language Server[18:45:00.345000]     return PylintLinter.lint(document, is_saved, flags=flags)

Python Language Server[18:45:00.345000]   File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pyls/plugins/pylint_lint.py", line 107, in lint

Python Language Server[18:45:00.345000]     for diag in json.loads(json_out):

Python Language Server[18:45:00.345000] ValueError: Expected object or value

Which gives, when we format traceback to keep python traceback only:

Exception in thread Thread-1:
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/threading.py", line 1254, in run
    self.function(*self.args, **self.kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pyls/_utils.py", line 36, in run
    return func(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pyls/python_ls.py", line 274, in lint
    flatten(self._hook('pyls_lint', doc_uri, is_saved=is_saved))
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pyls/python_ls.py", line 156, in _hook
    return hook_handlers(config=self.config, workspace=workspace, document=doc, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pluggy/hooks.py", line 286, in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pluggy/manager.py", line 93, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pluggy/manager.py", line 337, in traced_hookexec
    return outcome.get_result()
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pluggy/callers.py", line 80, in get_result
    raise ex[1].with_traceback(ex[2])
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pluggy/callers.py", line 52, in from_call
    result = func()
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pluggy/manager.py", line 335, in <lambda>
    outcome = _Result.from_call(lambda: oldcall(hook, hook_impls, kwargs))
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pluggy/manager.py", line 84, in <lambda>
    self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pluggy/callers.py", line 208, in _multicall
    return outcome.get_result()
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pluggy/callers.py", line 80, in get_result
    raise ex[1].with_traceback(ex[2])
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pluggy/callers.py", line 187, in _multicall
    res = hook_impl.function(*args)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pyls/plugins/pylint_lint.py", line 179, in pyls_lint
    return PylintLinter.lint(document, is_saved, flags=flags)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pyls/plugins/pylint_lint.py", line 107, in lint
    for diag in json.loads(json_out):
ValueError: Expected object or value
mmshivesh commented 4 years ago

This seems like a conflict with the PyLint plugin from the attached logs:

File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pyls/plugins/pylint_lint.py", line 107, in lint

Does the ignore flags work if you disable the Pylint plugin? Could you try the latest commit (6ba00da) and see if that fixes the issue?

Gugu7264 commented 4 years ago

Pylint plugin is disabled, I will try by deinstalling it then. Also using latest commit now 👍🏻

Gugu7264 commented 4 years ago

Ah well, I ran into an issue, how can I update the plugin using the latest commit?

mmshivesh commented 4 years ago

Just download the latest version of the repo and unzip. Nova should automatically recognize .novaextension files as an extension format.

Gugu7264 commented 4 years ago

Where do I put the folder I mean?

Gugu7264 commented 4 years ago

Also disabling pylint helped, though now PyDocStyle isn't taking in count ignored errors in settings.

mmshivesh commented 4 years ago

Just double click on the folder (it acts like a bundle folder) Nova should automatically prompt for install

Gugu7264 commented 4 years ago

Should I remove "-master" from the folder name then?

mmshivesh commented 4 years ago

Yup! A folder ending with .novaextension should do the trick

Gugu7264 commented 4 years ago

Just did, I could update the plugin!

Gugu7264 commented 4 years ago

Ok so now, by disabling pylint, PyCodeStyle works, though PyDocStyle doesn't, it report issues I marked as ignored in the preferences.

Gugu7264 commented 4 years ago

Any new about PyDocStyle?

mmshivesh commented 4 years ago

Sorry about that, i've been busy this week, I'll take a look at this soon

samdoran commented 3 years ago

I have been hitting these exact same issues: line length and McCabe complexity settings in the extension preferences are not honored.

I tried with the latest commit and that does seem to resolve the issue of McCabe complexity and line length settings not being honored. However, those settings seem to be revert the default values when Nova is restarted.

The settings are correct in the extension preferences after restart (20 for McCabe threshold and 159 for max line length), but the extension is not honoring them. Disabling/reenabling the extension after restarting Nova gets things working.

Thanks for making this extension. I find it really useful.

amw commented 2 years ago

Very similar issue. Cannot get rid of line length warning from PyCodeStyle even though I've disabled PyCodeStyle and PyLint in the extension's settings. How can a disabled plugin still generate warnings?

Gerzer commented 1 year ago

I can still reproduce this issue. Unfortunately, the inability to disable the linter renders this extension useless in any project that uses tabs for indentation due to the overload of linter warnings.

AdelaideSky commented 1 year ago

Can also reproduce this issue, no matter what i try (i disabled everything in the settings of the extension and restarted multiple times the software) lint warnings still show up... Only one thing disables the lint warnings: disabling the extension or putting a wrong server executable path :'D