In parallel to an issue over at AtomLinter, SublimeLinter-pylint produces spurious error messages when analysing dotted relative import statements inside a Python package.
For example, consider the following package (directory) structure:
working directory
| - package
| | - foo
| | | - bar.py
| | | - baz.py
In the module bar.py, it's totally fine (AFAIK) to write:
However, if you simply run
pylint package/foo/bar.py
it will show an error "Attempted relative import beyond top-level package", because it doesn't recognize bar.py is part of a package.
This is also what I see in the editor when SublimeLinter-pylint is enabled.
In order for pylint to acknowledge the package structure, you have to run
Is there any way for SublimeLinter to detect packages and adjust the calls to pylint accordingly?
Or is there at least a way to tell SublimeLinter-pylint where the package root is?
Please note: This is all Python 3.
In parallel to an issue over at AtomLinter, SublimeLinter-pylint produces spurious error messages when analysing dotted relative import statements inside a Python package.
For example, consider the following package (directory) structure:
In the module
bar.py, it's totally fine (AFAIK) to write:However, if you simply run
it will show an error "Attempted relative import beyond top-level package", because it doesn't recognize
bar.pyis part of a package.This is also what I see in the editor when SublimeLinter-pylint is enabled.
In order for
pylintto acknowledge the package structure, you have to runIs there any way for SublimeLinter to detect packages and adjust the calls to
pylintaccordingly?Or is there at least a way to tell SublimeLinter-pylint where the package root is?
Please note: This is all Python 3.