{"id":28376386,"url":"https://github.com/emacs-lsp/lsp-sonarlint","last_synced_at":"2026-03-14T16:24:52.153Z","repository":{"id":40402318,"uuid":"273054768","full_name":"emacs-lsp/lsp-sonarlint","owner":"emacs-lsp","description":"lsp-mode :heart: sonarlint","archived":false,"fork":false,"pushed_at":"2025-04-23T00:28:42.000Z","size":34672,"stargazers_count":88,"open_issues_count":11,"forks_count":13,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-06-15T19:13:15.448Z","etag":null,"topics":["emacs","emacs-lsp","java","javascript","lsp-client","python","sonarlint"],"latest_commit_sha":null,"homepage":"","language":"Emacs Lisp","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/emacs-lsp.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-06-17T18:52:34.000Z","updated_at":"2025-04-23T00:28:46.000Z","dependencies_parsed_at":"2023-01-26T09:00:14.004Z","dependency_job_id":"68acded5-5107-414a-89ba-a7a44738a88c","html_url":"https://github.com/emacs-lsp/lsp-sonarlint","commit_stats":{"total_commits":98,"total_committers":7,"mean_commits":14.0,"dds":"0.23469387755102045","last_synced_commit":"d2e72809f4463e874ae5cce8ba0bc8415ec7fb23"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/emacs-lsp/lsp-sonarlint","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emacs-lsp%2Flsp-sonarlint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emacs-lsp%2Flsp-sonarlint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emacs-lsp%2Flsp-sonarlint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emacs-lsp%2Flsp-sonarlint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/emacs-lsp","download_url":"https://codeload.github.com/emacs-lsp/lsp-sonarlint/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emacs-lsp%2Flsp-sonarlint/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262047820,"owners_count":23250421,"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":["emacs","emacs-lsp","java","javascript","lsp-client","python","sonarlint"],"created_at":"2025-05-30T00:06:43.126Z","updated_at":"2026-03-14T16:24:47.114Z","avatar_url":"https://github.com/emacs-lsp.png","language":"Emacs Lisp","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SonarLint for Emacs\n![License: GPLv3](https://img.shields.io/badge/License-GPLv3-blue.svg)\n[![MELPA](https://melpa.org/packages/lsp-sonarlint-badge.svg)](https://melpa.org/#/lsp-sonarlint)\n[![MELPA Stable](https://stable.melpa.org/packages/lsp-sonarlint-badge.svg)](https://stable.melpa.org/#/lsp-sonarlint)\n\u003ca href=\"https://www.sonarlint.org/\"\u003e \u003cimg align=\"right\" width=\"120\" src=\"./images/SonarLint_icon.svg\"\u003e\u003c/a\u003e\n\nSonarLint™ is a free IDE extension that lets you fix coding issues before they exist!\n\nLike a spell checker,it highlights Bugs and Security Vulnerabilities as you write code, with clear remediation guidance so you can fix them before the code is even committed.\n\nIn Emacs supports analysis of JavaScript, TypeScript, Python, Java, HTML, PHP, C/C++,\nGo, and XML out of the box!\n\n:warning: This is not an official [SonarSource](https://www.sonarsource.com/) extension\n\n![Flycheck gif](https://gitlab.com/sasanidas/lsp-sonarlint/-/raw/master/examples/sonarlint-example.gif \"Flycheck gif\")\n\n## How it works\n\nlsp-sonarlint relies on the [official vscode extension](https://github.com/SonarSource/sonarlint-vscode/), which is downloaded and unzipped.\n\nThe official VSCode extension typically contains :\n- A language server (written in java)\n- A Java runtime\n- Analysers for 10+ languages\n- A VSCode front-end\n\nlsp-sonarlint is emacs's equivalent of the VSCode front-end, but only\nimplements the base feature set, i.e linting and rules viewing.\n\n## Requirements\n\n- emacs \u003e= 25\n- [lsp-mode](https://github.com/emacs-lsp/lsp-mode)\n- [ht](https://github.com/Wilfred/ht.el)\n- [dash](https://github.com/magnars/dash.el)\n\nTo analyze JavaScript and TypeScript, SonarLint will also need Node.js.\n\nTo analyse C/C++ projects, SonarLint's CFamily analyzer will need both a working compiler and a\ncompile_commands.json which is typically generated by [cmake](https://github.com/rizsotto/Bear) or [bear](https://github.com/rizsotto/Bear).\n\n## Installation\n\n## Source\nDownload and include the main file lsp-sonarlint.el.\n\n### Melpa\nYou can then run the following commands to install lsp-sonarlint:\n\n```\nM-x package-refresh-contents RET      (to refresh your package database)\nM-x package-install RET lsp-sonarlint RET   (to install and compile `lsp-sonarlint` and its dependencies)\n```\n\n## Usage\nThe language server relies on java plugins to properly analyze the selected language source code.\n\nBy default all are enabled, but you can specify the ones you want.\n\n``` lisp\n(use-package lsp-sonarlint\n  :custom\n  ;; Allow sonarlint to download and unzip the official VSCode extension\n  ;; If nil, you'll have to do that yourself. See also `lsp-sonarlint-download'\n  ;; `lsp-sonarlint-download-url' and `lsp-sonarlint-download-dir'\n  (lsp-sonarlint-auto-download t)\n\n  ;; Choose which analyzers you want enabled. By default all are enabled\n  ;; See command `lsp-sonarlint-available-analyzers' for the full list.\n  (lsp-sonarlint-enabled-analyzers '(\"java\" \"cfamily\" \"python\" \"text\")))\n```\n\n\u003e [!WARNING]\n\u003e On windows, lsp-sonarlint may encounter [this issue](https://github.com/emacs-lsp/lsp-mode/issues/3022) while unzipping the VSCode extension. If you do, try the following :\n```elisp\n(setq lsp-unzip-script lsp-ext-pwsh-script)\n```\n\n## Static Analysis Rules\n\nOut of the box, SonarLint automatically checks your code against the following rules:\n\n- [JavaScript rules](https://rules.sonarsource.com/javascript)\n- [TypeScript rules](https://rules.sonarsource.com/typescript)\n- [Python rules](https://rules.sonarsource.com/python)\n- [Java rules](https://rules.sonarsource.com/java)\n- [HTML rules](https://rules.sonarsource.com/html)\n- [PHP rules](https://rules.sonarsource.com/php)\n- [XML rules](https://rules.sonarsource.com/xml)\n- [Go rules](https://rules.sonarsource.com/go)\n- [C rules](https://rules.sonarsource.com/c)\n- [C++ rules](https://rules.sonarsource.com/cpp)\n- [Bidi (bidirectional unicode characters)](https://rules.sonarsource.com/text/) + [Secrets](https://rules.sonarsource.com/secrets/)\n\n## Supported settings\n\n* `lsp-sonarlint-auto-download` - Set to t to enable auto-downloading of VSCode's extension on startup.\n* `lsp-sonarlint-download-url` - Specify another URL for the VSCode extension.\n* `lsp-sonarlint-download-dir` - Specify where VSCode's extension will be downloaded and unzipped.\n* `lsp-sonarlint-use-system-jre` - If t, use the system Java runtime instead of the bundled one.\n* `lsp-sonarlint-enabled-analyzers` - List of analyzers to enable. Defaults to 'all for all analyzers.\n* `lsp-sonarlint-modes-enabled` - List of major modes where the lsp server will activate.\n* `lsp-sonarlint-disable-telemetry` - Disable telemetry option (disabled by default).\n* `lsp-sonarlint-test-file-pattern` - Regex to find test file, most rules are not evaluated on test files.\n* `lsp-sonarlint-show-analyzer-logs` - Show analyzer logs.\n* `lsp-sonarlint-verbose-logs` - Make SonarLint logs verbose.\n* `lsp-sonarlint-cfamily-compilation-commands-path` - Path to compile_commands.json for C/C++ analysis.\n\n### Available commands\n* `lsp-sonarlint-download` - Download the VSCode extension and unzip it. Called automatically\nif `lsp-sonarlint-auto-download`is set to t\n* `lsp-sonarlint-available-analyzers` - List all available analyzers provided by the downloaded VSCode extension.\n\n### Plugins additional info\n\nFor most analyzers, lsp-sonarlint provides variables describing additional\ninfo.\n\n* `lsp-sonarlint-LANGUAGE-doc-url` - Sonarsource official plugin documentation\n* `lsp-sonarlint-LANGUAGE-repository-url` - Plugin source code\n\n### Plugins not tested yet\nCurrently, sonarlint's vscode extension also provides omnisharp and Infrastructure As Code (IAC)\nanalyzers. They have not been tested yet, you may expect some additional configuration\nto make them work.\nYou'll at least need to add the major-modes to `lsp-sonarlint-modes-enabled'.\n\nFeel free to try them out and provide feedback.\n\n## Data and telemetry\n\nThis extension collects anonymous usage data and sends it to SonarSource.\n\nCollection of telemetry is controlled via the setting: `lsp-sonarlint-disable-telemetry`, it is disable by default.\n\nClick [here](https://github.com/SonarSource/sonarlint-vscode/blob/master/telemetry-sample.md) to see a sample of the data that are collected.\n\n## Additional packages\n\n* [lsp-ui](https://github.com/emacs-lsp/lsp-ui) : Flycheck, documentation and code actions support.\n* [company-capf](https://github.com/company-mode/company-mode) : Completion backend support.\n* [treemacs](https://github.com/Alexander-Miller/treemacs) : Project viewer.\n* [lsp-treemacs](https://github.com/emacs-lsp/lsp-treemacs) : `lsp-mode` GUI controls implemented using treemacs.\n\n## Development\n\n### Prerequisites\n\nYou will need `make` and [`eask`](https://emacs-eask.github.io/) to run `lsp-sonarlint` tests.\nSee also (Requirements)(#requirements) section.\n\nIf you do not have `eask` installed, you can install it locally with:\n\n``` shell\nnpm install @emacs-eask/cli\nexport EASK=\"$PWD/node_modules/@emacs-eask/cli/eask\"\n```\n\nOr globally with:\n\n``` shell\nnpm install -g @emacs-eask/cli\n```\n\n### Testing\n\nWe use [Emacs ERT](https://www.gnu.org/software/emacs/manual/html_node/ert/) for testing.\nYou can run tests with:\n\n``` shell\nmake package\nmake install\nmake compile\nmake download-sonarlint\nmake test\n```\n\n#### Interactive Testing\n\nYou can also run the tests one-by-one interactively.\n\nOpen a test file from tests/*.el in Emacs.\nEvaluate the file contents (`eval-buffer`) to load test definitions into the session.\nRun `ert` command to run all or selected tests.\nTo run the integration tests, you will have to shut down all your lsp workspaces\nto ensure consistent starting state.\n\nCheck out `*lsp-log*`, `*lsp-log: sonarlint:NNNNNNNN*`, `*sonarlint*`, `*sonarlint:stderr*`\nfor logs when troubleshooting a test.\n\nYou can start with test/trivial-test.el to check that your testing harness works.\n\n## Contributions\n\nContributions are very much welcome.\n\n#### Copyright\n\nSONARLINT and SONARSOURCE are trademarks of SonarSource SA.\nAll other trademarks and copyrights are the property of their respective owners.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femacs-lsp%2Flsp-sonarlint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femacs-lsp%2Flsp-sonarlint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femacs-lsp%2Flsp-sonarlint/lists"}