Skip to content

No documentation about turning on pylint #611

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
technillogue opened this issue Jul 1, 2019 · 3 comments
Open

No documentation about turning on pylint #611

technillogue opened this issue Jul 1, 2019 · 3 comments

Comments

@technillogue
Copy link

It's highly unclear how to enable pylint (and disable pyflakes, flake8, etc).

@ckm2k1
Copy link

ckm2k1 commented Jan 27, 2020

@technillogue Here's my settings section from a .sublime-project file

"settings": {
    "LSP": {
      "pyls": {
        "command": ["/Users/myuser/.virtualenvs/theenv/bin/pyls"],
        "enabled": true,
        "languageId": "python",
        "scopes": ["source.python"],
        "env": {
          "PYTHONPATH": "/Users/myuser/.virtualenvs/theenv/lib/python3.7/site-packages",
          "PATH": "$PATH:/Users/myuser/.virtualenvs/theenv/bin"
        },
        "settings": {
          "pyls": {
            "configurationSources": ["flake8"],
            "plugins": {
              "yapf": {
                "enabled": true
              },
              "pyflakes": {
                "enabled": false
              },
              "mccabe": {
                "enabled": false
              },
              "flake8": {
                "enabled": true
              }
            }
          }
        },
        "syntaxes": ["Packages/Python/Python.sublime-syntax"]
      }
    },
    "python_interpreter": "/Users/myuser/.virtualenvs/theenv/bin/python",
    "python_package_paths": [
      "$project_path/agent",
      "$home/.virtualenvs/theenv/lib/python3.7"
    ],
    ...snip
  }

You can add a "pylint" section in the plugins object and turn it on. Don't forget to install python-language-server[pylint] as well.

Note also the "env" section, adding the /bin directory to PATH is crucial for the plugins to be able to find their respective commands. I had this issue with flake8 where everything was configured correctly but the implementation was trying to run flake8 or python -m flake8 both of which were failing because they were not found in the plugins environment.

One more trick that helped me a lot in debugging these issues is to change the command for running pyls to the follwoing:

"command": ["/Users/myuser/.virtualenvs/theenv/bin/pyls", "-vv", "--log-file=/tmp/lsp.log"]

Create the /tmp/lsp.log file and restart the pyls server after making these changes. This will enable really verbose logging from the pyls server into that log file and let you see why plugin execution is failing/working.

@robertsawko
Copy link

robertsawko commented Mar 17, 2020

Hi,

Sorry to bump this thread.

What about other editors? Are there any configuration files specific to pyls?

I am trying to get pylint active using LanguageClient-neovim. According to another issue over here, there exist a workspace specific json file to control server settings, but I can't get it to work.

@astier
Copy link

astier commented Aug 3, 2020

I find the documentation also rather lacking. Pylint isn't even mentioned in the README.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants