Skip to content
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

How to configure pyls? #171

Closed
dynobo opened this issue Jan 21, 2020 · 7 comments · Fixed by #172
Closed

How to configure pyls? #171

dynobo opened this issue Jan 21, 2020 · 7 comments · Fixed by #172
Labels
documentation Improvements or additions to documentation

Comments

@dynobo
Copy link

dynobo commented Jan 21, 2020

What I am trying to do...

... is to configure pyls (pycodestyle) to ignore some errors. If possible, I would like to disable pycodestyle completely and go only with pyflakes. (I use black as formatter, which produces a lot of "false positives" in pycodestyle)

How I would like to learn how to do it...

It would be great to see an example of a more extensive jupyter-lab configuration for jupyterlab-lsp. So far the only example I found is this generic "dummy"-snippet here:

{
  "LanguageServerManager": {
    "language_servers": {
      "a-language-server-implementation": {
        "argv": ["/absolute/path/to/a-language-server", "--stdio"],
        "languages": ["a-language"]
      }
    }
  }
}

I have found the necessary pyls configuration in this schema file, but I don't know if/how this can be integrated/overwritten using jupyter labs extensions settings.

Thanks!

@bollwyvl
Copy link
Collaborator

bollwyvl commented Jan 21, 2020 via email

@krassowski
Copy link
Member

In particular, please check this: https://github.com/krassowski/jupyterlab-lsp/issues/128#issuecomment-570894117 and let us know if it helped you.

@krassowski krassowski added the documentation Improvements or additions to documentation label Jan 21, 2020
krassowski added a commit that referenced this issue Jan 21, 2020
Closes #171 and fixes #128
@krassowski krassowski mentioned this issue Jan 21, 2020
4 tasks
@dynobo
Copy link
Author

dynobo commented Jan 21, 2020

Thx, @krassowski , setting the ignore in setup.cfg like you described worked for me :-)

Is it also possible to use flake8 or pyls-black instead of pycodestyle? Or is this not possible yet?

The pls docu you linked mentions I have to set "pyls.configurationSource": ["flake8"] but I don't know where and if this is possible already.

BTW: Thanks for this useful extension! Love the autocomplete!

@krassowski
Copy link
Member

I think that switching to flake8 will require the configuration GUI, not sure if this can be achieved straightaway. I will try to expose some of the settings in the 0.8 release.

@dynobo
Copy link
Author

dynobo commented Jan 21, 2020

Perfect, thanks!

@krassowski
Copy link
Member

And happy that you enjoy it! Please do not hesitate to share this extension and contribute (even small documentation improvements help a lot!).

@RobertoMaurizzi
Copy link

@dynobo from past experiences with pyls the best way to avoid running the checkers you want is to NOT install the others: when you install pyls, use pip install python-language-server instead of pip install python-language-server[all] then install only the checkers you need/want (i.e pip install rope pyls-black etc.).
Right now you can probably pip uninstall pycodestyle and any other plugin you know it is doing extra checks or changes you don't want.

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

Successfully merging a pull request may close this issue.

4 participants