DetachHead / basedpyright

pyright fork with various type checking improvements, improved vscode support and pylance features built into the language server
https://docs.basedpyright.com
Other
1.18k stars 22 forks source link

add new `typeCheckingMode` that enables everything except the rules covered by ruff #203

Open steakhutzeee opened 7 months ago

steakhutzeee commented 7 months ago

Hi,

i'm actually using the following config for Pyright in order to avoid duplicates with ruff_lsp. What should be the equivalent for basedpyright?

return {
  settings = {
    basedpyright = {
      -- Using Ruff's import organizer
      disableOrganizeImports = true,
    },
    --python = {
    --  analysis = {
    --    -- Ignore all files for analysis to exclusively use Ruff for linting
    --    ignore = { '*' },
    --    -- Using mypy
    --    typeCheckingMode = 'off',
    --  },
    --},
  },
  capabilities = {
    textDocument = {
      publishDiagnostics = {
        tagSupport = {
          valueSet = { 2 }, -- prevent duplicates with ruff_lsp https://github.com/microsoft/pyright/issues/4652
        },
      },
    },
  }
}
DetachHead commented 7 months ago

so you want to disable basedpyright's type checking entirely? setting typeCheckingMode to 'off' in the basedpyright section should do the trick

steakhutzeee commented 7 months ago

Not entirely sure as I just started using Neovim with based/pyright and ruff_lsp.

Was following this https://github.com/astral-sh/ruff-lsp/issues/384#issuecomment-1992012227 and this https://github.com/astral-sh/ruff-lsp/issues/384#issuecomment-1989619482 to not completely disable pyright typing but only the duplicated hints.

KotlinIsland commented 7 months ago

Basedpyright does make some extra changes to disable more things than pyright does when you set it to 'off', not sure if that is documented properly though

KotlinIsland commented 7 months ago

Here: https://github.com/DetachHead/basedpyright/issues/53

steakhutzeee commented 7 months ago

This way it looks like i'm disabling the typing entirely, and also i see duplicates as in attached screen.

return {
  settings = {
    basedpyright = {
      -- Using Ruff's import organizer
      disableOrganizeImports = true,
      typeCheckingMode = 'off',
    },
  },
}

Screenshot 2024-03-25 150726

DetachHead commented 7 months ago

maybe check this repo's pyproject.toml, since i also use ruff and disable conflicting rules

maybe i could add a new typeCheckingMode that enables everything except the rules covered by ruff, so users don't have to configure it manually

KotlinIsland commented 7 months ago

Ah yes

steakhutzeee commented 7 months ago

Also noted that basedpyright has duplicates itself, as this error/hint:

Screenshot 2024-03-26 090919

DetachHead commented 7 months ago

yeah that's the same issue as #149

steakhutzeee commented 3 months ago

Could basedpyright.disableLanguageServices help in avoiding duplicates with ruff language server?

Maybe it will disable too much features.

DetachHead commented 3 months ago

i think that only disables things like autocomplete, import suggestions, go to definition, etc. which are all things ruff currently can't do