basedpyright icon indicating copy to clipboard operation
basedpyright copied to clipboard

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

Open steakhutzeee opened this issue 2 years ago • 14 comments

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
        },
      },
    },
  }
}

steakhutzeee avatar Mar 25 '24 13:03 steakhutzeee

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

DetachHead avatar Mar 25 '24 13:03 DetachHead

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.

steakhutzeee avatar Mar 25 '24 13:03 steakhutzeee

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 avatar Mar 25 '24 13:03 KotlinIsland

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

KotlinIsland avatar Mar 25 '24 14:03 KotlinIsland

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

steakhutzeee avatar Mar 25 '24 14:03 steakhutzeee

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

DetachHead avatar Mar 25 '24 21:03 DetachHead

Ah yes

  • https://github.com/DetachHead/basedpyright/issues/149 This needs to be added to the "off means off" feature

KotlinIsland avatar Mar 26 '24 02:03 KotlinIsland

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

Screenshot 2024-03-26 090919

steakhutzeee avatar Mar 26 '24 08:03 steakhutzeee

yeah that's the same issue as #149

DetachHead avatar Mar 26 '24 08:03 DetachHead

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

Maybe it will disable too much features.

steakhutzeee avatar Jul 22 '24 15:07 steakhutzeee

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

DetachHead avatar Jul 22 '24 20:07 DetachHead