{"id":15441616,"url":"https://github.com/yaegassy/coc-pysen","last_synced_at":"2025-04-19T19:40:25.952Z","repository":{"id":46096105,"uuid":"357122589","full_name":"yaegassy/coc-pysen","owner":"yaegassy","description":"pysen-ls (pysen language server) extension for coc.nvim. Python linting, formatting made easy. ","archived":false,"fork":false,"pushed_at":"2022-05-12T03:17:16.000Z","size":98,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-19T01:33:00.466Z","etag":null,"topics":["coc","coc-extensions","coc-nvim","formatter","linter","neovim","pysen","python","vim"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@yaegassy/coc-pysen","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yaegassy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-04-12T08:51:59.000Z","updated_at":"2024-07-01T06:10:05.000Z","dependencies_parsed_at":"2022-09-03T06:52:47.104Z","dependency_job_id":null,"html_url":"https://github.com/yaegassy/coc-pysen","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaegassy%2Fcoc-pysen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaegassy%2Fcoc-pysen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaegassy%2Fcoc-pysen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaegassy%2Fcoc-pysen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yaegassy","download_url":"https://codeload.github.com/yaegassy/coc-pysen/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249782731,"owners_count":21324999,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["coc","coc-extensions","coc-nvim","formatter","linter","neovim","pysen","python","vim"],"created_at":"2024-10-01T19:21:33.233Z","updated_at":"2025-04-19T19:40:25.901Z","avatar_url":"https://github.com/yaegassy.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# coc-pysen\n\n\u003e fork from a [bonprosoft/pysen-vscode](https://github.com/bonprosoft/pysen-vscode)\n\n[pysen-ls](https://pypi.org/project/pysen-ls/) ([pysen](https://github.com/pfnet/pysen) language server) extension for [coc.nvim](https://github.com/neoclide/coc.nvim).\n\nPython linting, formatting made easy.\n\n\u003cimg width=\"780\" alt=\"coc-pysen-demo\" src=\"https://user-images.githubusercontent.com/188642/114372002-0d0c5100-9bbc-11eb-9196-20a986887dee.gif\"\u003e\n\n## Note\n\nDue to the nature of the tool, it may take some time for the formatter to complete its execution.\n\nYou may want to refrain from setting up automatic formatting when saving files.\n\n## Install\n\n**CocInstall**:\n\n```vim\n:CocInstall @yaegassy/coc-pysen\n```\n\n\u003e scoped packages\n\n**vim-plug**:\n\n```vim\nPlug 'yaegassy/coc-pysen', {'do': 'yarn install --frozen-lockfile'}\n```\n\n## Require: pyproject.toml\n\nTo run linter and formatter in \"pysen\", you need `pyproject.toml`.\n\n**e.g. pyproject.toml**:\n\n```toml\n[tool.pysen]\nversion = \"0.10\"\n\n[tool.pysen.lint]\nenable_black = true\nenable_flake8 = true\nenable_isort = true\nenable_mypy = true\nmypy_preset = \"strict\"\nline_length = 88\npy_version = \"py37\"\n[[tool.pysen.lint.mypy_targets]]\n  paths = [\".\"]\n```\n\n**More Info**:\n\nCheck the README of \"pysen\".\n\n- [Quickstart: Set up linters using pysen](https://github.com/pfnet/pysen#quickstart-set-up-linters-using-pysen)\n- [Frequently Asked Questions](https://github.com/pfnet/pysen#frequently-asked-questions)\n\n## Detect: pysen-ls\n\n`coc-pysen` detects and starts `pysen-ls`.\n\n**Priority to detect**:\n\n1. `pysen.pysenLsPath`\n2. current python3 environment (e.g. pysen-ls in venv)\n3. builtin pysen-ls (Installation commands are also provided)\n\n## Bult-in install\n\ncoc-pysen allows you to create an extension-only \"venv\" and install \"pysen-ls\".\n\nAlso install flake8, mypy, black, and isort together.\n\nYou can also specify the version of each tool. (setting: `pysen.bultin.flake8Version`, `pysen.bultin.mypyVersion`, `pysen.bultin.blackVersion`, `pysen.bultin.isortVersion`)\n\n----\n\nThe first time you use coc-pysen, if pysen-ls is not detected, you will be prompted to do a built-in installation.\n\nYou can also run the installation command manually.\n\n```\n:CocCommand pysen.installServer\n```\n\n## Configuration options\n\n- `pysen.enable`: Enable coc-pysen extension, default: `true`\n- `pysen.pysenLsPath`: (Optional) The custom path to the pysen-ls (Absolute path)\n- `pysen.bultin.flake8Version`: (Optional) Version of flake8 for built-in install, e.g. \"3.9.0\", default: `\"\"`\n- `pysen.bultin.mypyVersion`: (Optional) Version of mypy for built-in install, e.g. \"0.812\", default: `\"\"`\n- `pysen.bultin.blackVersion`: (Optional) Version of black for built-in install, e.g. \"20.8b1\", default: `\"\"`\n- `pysen.bultin.isortVersion`: (Optional) Version of isort for built-in install, e.g. \"5.8.0\", default: `\"\"`\n- `pysen.client.connectionMode`: Controls the communication method to pysen-ls, valid options `[\"stdio\", \"tcp\"]`, default: `\"stdio\"`\n  - `stdio`: Use stdio to communicate with pysen-ls.\n  - `tcp`: Use tcp to connect pysen-ls. You need to launch pysen-ls.\n- `pysen.client.pythonPath`: (Optional) Specifies the python path to use pysen, default: `\"\"`\n- `pysen.client.tcpHost`: Specifies the host name to connect pysen-ls server. This setting only works with connectionMode is 'tcp', default: `127.0.0.1`\n- `pysen.client.tcpPort`: Specifies the port to connect pysen-ls server. This setting only works with connectionMode is 'tcp', default: `3746`\n- `pysen.server.enableLintOnSave`: Controls whether to trigger the lint task on save, default: `true`\n- `pysen.server.enableCodeAction`: Enable/disable code actions, default: `true`\n- `pysen.server.lintTargets`: Controls target names for pysen to invoke in the lint task, default: `[\"lint\"]`\n- `pysen.server.formatTargets`: Controls target names for pysen to invoke in the format task, default: `[\"format\", \"lint\"]`\n- `pysen.trace.server`: Traces the communication between coc.nvim and the pysen language server, default: `\"off\"`\n\n## Commands\n\n- `pysen.installServer`: Install pysen-ls (builtin)\n  - It will be installed in this path:\n    - Mac/Linux: `~/.config/coc/extensions/@yaegassy/coc-pysen-data/pysen-ls/venv/bin/pysen_language_server`\n    - Windows: `~/AppData/Local/coc/extensions/@yaegassy/coc-pysen-data/pysen-ls/venv/bin/pysen_language_server`\n- `pysen.triggerLintDocument`: Lint Current Document\n- `pysen.triggerLintWorkspace`: Lint Entire Workspace\n- `pysen.triggerFormatDocument`: Format Current Document\n- `pysen.triggerFormatWorkspace`: Format Entire Workspace\n- `pysen.triggerFormatWorkspace`: Format Entire Workspace\n\n## What's \"pysen\"\n\n- Blog post\n  - (English)\n    - \u003chttps://tech.preferred.jp/en/blog/pysen-is-the-new-sempai/\u003e\n  - (Japanese)\n    - \u003chttps://tech.preferred.jp/ja/blog/pysen-is-the-new-sempai/\u003e\n\n## Simlar vim plugins\n\n- [bonprosoft/pysen.vim](https://github.com/bonprosoft/pysen.vim)\n\n## Thanks\n\n- [pfnet/pysen](https://github.com/pfnet/pysen)\n- [bonprosoft/pysen-ls](https://github.com/bonprosoft/pysen-ls)\n- [bonprosoft/pysen-vscode](https://github.com/bonprosoft/pysen-vscode)\n\n## License\n\nMIT\n\n---\n\n\u003e This extension is built with [create-coc-extension](https://github.com/fannheyward/create-coc-extension)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyaegassy%2Fcoc-pysen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyaegassy%2Fcoc-pysen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyaegassy%2Fcoc-pysen/lists"}