{"id":28496095,"url":"https://github.com/sonarsource/sonar-developer-toolset","last_synced_at":"2025-07-02T15:31:21.746Z","repository":{"id":2203891,"uuid":"3152588","full_name":"SonarSource/sonar-developer-toolset","owner":"SonarSource","description":"Developer Toolset for Sonar-* Projects","archived":false,"fork":false,"pushed_at":"2025-07-01T14:03:57.000Z","size":2987,"stargazers_count":42,"open_issues_count":0,"forks_count":32,"subscribers_count":38,"default_branch":"master","last_synced_at":"2025-07-01T15:23:02.523Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SonarSource.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":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2012-01-11T09:43:39.000Z","updated_at":"2025-07-01T14:03:59.000Z","dependencies_parsed_at":"2025-06-17T14:40:26.278Z","dependency_job_id":null,"html_url":"https://github.com/SonarSource/sonar-developer-toolset","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/SonarSource/sonar-developer-toolset","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SonarSource%2Fsonar-developer-toolset","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SonarSource%2Fsonar-developer-toolset/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SonarSource%2Fsonar-developer-toolset/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SonarSource%2Fsonar-developer-toolset/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SonarSource","download_url":"https://codeload.github.com/SonarSource/sonar-developer-toolset/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SonarSource%2Fsonar-developer-toolset/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263165766,"owners_count":23424006,"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":[],"created_at":"2025-06-08T11:38:42.422Z","updated_at":"2025-07-02T15:31:21.222Z","avatar_url":"https://github.com/SonarSource.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Developer Toolset for Sonar-* Projects\n\nToolset for the developers contributing to http://github.com/SonarSource and http://github.com/SonarCommunity repositories.\n\n## SonarLint\n\n[Dogfooding](https://en.wikipedia.org/wiki/Eating_your_own_dog_food) is a core principle at SonarSource. Installing [SonarLint](http://sonarlint.org/) in your favorite IDE is strongly recommended. Any feedback should be provided on:\n* for SonarSourcer: the [category Dogfooding\u003eSonarLint of the internal forum](https://discuss.sonarsource.com/c/dogfood/sl) and/or the Slack channels:\\\n  SonarLint for Eclipse: [#squad-ide-eclipse](https://sonarsource.slack.com/archives/C03QE05EX26)\\\n  SonarLint for IntelliJ: [#squad-ide-intellij-family](https://sonarsource.slack.com/archives/C03QDTTJ5JP)\\\n  SonarLint for Visual Studio: [#squad-ide-visualstudio](https://sonarsource.slack.com/archives/C03PE8P8TK6)\\\n  SonarLint for Visual Studio Code: [#squad-ide-vscode](https://sonarsource.slack.com/archives/C03M0AJ3BKR)\n* for community: the [SonarSource forum](https://community.sonarsource.com/), using the tag `sonarlint`.\n\nThe \"connected mode\" feature should also be enabled and configured with https://next.sonarqube.com/ or https://sonarcloud.io, depending on projects.\n\nEclipse users should also rely on the dogfooding Eclipse Update Site in order to experiment latest milestones:\n* Help → Install New Software ...\n* Add a repository pointing to https://binaries.sonarsource.com/SonarLint-for-Eclipse/dogfood/\n* Initially install the plug-in, to check for updates: Help → Check for Updates\n\nIntellij users should also rely on the development marketplace in order to experiment latest milestones:\n* Open Settings → Plugins → Manage plugins repositories\n* Add a custom plugin repository pointing to https://repox.jfrog.io/repox/sonarsource-public-builds/org/sonarsource/sonarlint/intellij/sonarlint-intellij/updatePlugins.xml\n\n## Git\n\nIf you have never used Git before, you need to do some setup first. Run the following commands so that Git knows your name and email.\n\n    git config --global user.name \"Your Name\"\n    git config --global user.email \"your@email.com\"\n\nSetup line endings preferences:\n\n    # For Unix/Mac users\n    git config --global core.autocrlf input\n    git config --global core.safecrlf true\n\n    # For Windows users\n    git config --global core.autocrlf true\n    git config --global core.safecrlf true\n\nOn Windows, you must explicitly tell Git to use long paths so you won't run into issues with files in deeply nested directories:\n\n    git config --global core.longpaths true\n\nThe merge is working pretty well on small repositories (with move and rename of files). But it's not working on large repositories as the detection of file renaming is O(n²), so we need to update some threshold (more explanations are available in this post : http://blogs.atlassian.com/2011/10/confluence_git_rename_merge_oh_my/) :\n\n    git config --global merge.renameLimit 10000\n\n#### Commit messages\n\nCommits must relate to a JIRA issue. Convention for messages inspired by http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html :\n\n* The first line should be short (72 chars or less) and auto-descriptive in a format \"\u003cJIRA KEY\u003e \u003cDESCRIPTION\u003e\", for example \"SONAR-1937 Code review\"\n* Write your commit message in present imperative tense: \"Fix bug\" and not \"Fixed bug\".\n* The second line is blank.\n* Next lines optionally define a short summary of changes (wrap them to about 72 chars or so).\n\nExample :\n\n    SONAR-2204,SONAR-2259 Fix URL encoding\n\n    * For correct URL encoding we must encode parameters on lower level -\n    in Query itself, but not in concrete implementation of Connector,\n    because in Query we can distinguish concrete parts of URL.\n\n    * Moreover in this case any additional encoding routines in Connector\n    are useless, so were removed.\n\nIf the change concerns a documentation-only change, then prefix it with \"DOC \".\n\n## GitHub Configuration\n\nThe following points must be respected in the GitHub account settings:\n* If using your personal Github Account, the sonarsource email address must be set as primary\n* Uncheck \"Keep my email addresses private\"\n* The same name must be used in the Github profile and in the local git config key user.name\n\n## Eclipse Configuration\n\nEclipse settings are available in the directory [/eclipse](/eclipse).\n\n### Imports\n\n[sonar-formatter.xml](/eclipse/sonar-formatter.xml):\npositions new lines, comments, spaces, parentheses, etc. To be imported in Window \u003e Preferences \u003e Java \u003e Code Style \u003e Formatter.\n\n[sonar.importorder](/eclipse/sonar.importorder):\norganizes the \"import\" lines. To be imported in Window \u003e Preferences \u003e Java \u003e Code Style \u003e Organize Imports.\n\n[sonar-cleanup.xml](/eclipse/sonar-cleanup.xml):\ncleans up the code, by organizing imports, formating source code, correcting indentation, etc.\nTo be imported in Window \u003e Preferences \u003e Java \u003e Code Style \u003e Clean Up.\n\nIn Windows \u003e Preferences \u003e Java \u003e Editor \u003e Save Actions, check the checkboxes to perform the clean\nup at every \"save\" action. The \"additional actions\" displayed should be configured as well.\n\n![Eclipse Auto Save](eclipse/eclipse-Java-save-action.png)\n\n### Additional Configuration\n\nIn Window \u003e Preferences \u003e Maven \u003e Errors/Warnings, set \"Plugin execution not covered by lifecycle execution\" to \"Ignore\". This will silence out error messages when importing your Maven projects\n\nOn Windows, in Window \u003e Preferences \u003e General \u003e Workspace, set \"Text file encoding\" to \"UTF-8\" and \"New text file line delimiter\" to \"Unix\".\n\n## Code Style Configuration for Intellij\n\n### Eclipse Code Formatter\nIntellij IDEA users must install the plugin [Adapter for Eclipse Code Formatter](http://plugins.jetbrains.com/plugin/?id=6546):\n* Check `Use the Eclipse code formatter`\n* Set `Eclipse workspace/project folder or config file` to [sonar-formatter.xml](/eclipse/sonar-formatter.xml)\n* Check `Optimize Imports (IntelliJ's Import Optimizing must be turned ON)`\n* Set `Import Order from file` to [sonar.importorder](/eclipse/sonar.importorder)\n![Intellij code style](intellij/intellij-eclipse-formatter-config.png)\n\n### General Editor\nGo to `Preferences/Settings \u003e Editor \u003e General`:\n* Check `Ensure every saved file ends with a line break` (under the `On Save` section).\n\nGo to `Preferences/Settings \u003e Editor \u003e General \u003e Auto import`:\n* Check `Optimize imports on the fly` for Java:\n\n![image](https://user-images.githubusercontent.com/50145663/135304815-0b51f1da-16d4-4fc7-a278-a13067e78d7c.png)\n\n### Automatic IntelliJ Code Style\nYou can either import the code style settings to IntelliJ IDEA by simply importing [this scheme](intellij/codestyle_sonar_developer_toolset.xml) in IDEA's code style settings (`Editor \u003e 'Code Style' \u003e Java \u003e 'Scheme' \u003e ⚙️  \u003e 'Import Scheme' \u003e 'IntelliJ IDEA code style XML'`),\nor you can apply the settings manually (see below). The result should be the same.\n\n### Manual Java Code Style\nFollow these steps to set code style settings if not using [this scheme](intellij/codestyle_sonar_developer_toolset.xml) from above.\n\nGo to `Preferences/Settings \u003e Editor \u003e Code Style \u003e Java \u003e Tabs and Indents`:\n* Set `Tab size` to 2\n* Set `Indent` to 2\n* Set `Continuation indent` to 2\n\n![Intellij imports](intellij/intellij-java-indents.png)\n\nGo to `Preferences/Settings \u003e Editor \u003e Code Style \u003e Java \u003e Wrapping and Braces \u003e Method declaration parameter`:\n* Uncheck `Align when multiline`\n\nGo to `Preferences/Settings \u003e Editor \u003e Code Style \u003e Java \u003e JavaDoc \u003e Other`:\n* Uncheck `Generate \"\u003cp\u003e\" on empty lines`\n\nGo to `Preferences/Settings \u003e Editor \u003e Code Style \u003e Java \u003e Imports`\n* Set `Class count to use import with '*'` to 999\n* Set `Names count to use static import with '*'` to 999\n* Remove both lines from `Packages to Use Import with '*'`\n* Set `Import Layout` to:\n  * `import all other imports`\n  * `\u003cblank line\u003e`\n  * `import static all other imports`\n  * `import module imports`\n\n![Intellij imports](intellij/intellij-imports.png)\n\n### Manual Kotlin Code Style\nGo to `Preferences/Settings \u003e Editor \u003e Code Style \u003e Kotlin \u003e Tabs and Indents`:\n* Set `Tab size` to 4\n* Set `Indent` to 4\n* Set `Continuation indent` to 4\n\n![Kotlin indents](intellij/intellij-kotlin-indents.png)\n\nGo to `Preferences/Settings \u003e Editor \u003e Code Style \u003e Kotlin \u003e Imports`:\n* Select `Use single name import` in `Top-Level Symbols`\n* Select `Use single name import` in `Java Statics and Enum Members`\n* Remove all entries from the list `Packages to Use Imports with '*'`\n\n![Kotlin imports](intellij/intellij-kotlin-imports.png)\n\nGo to `Preferences/Settings \u003e Editor \u003e Code Style \u003e Kotlin \u003e Other`:\n* Check `Use trailing comma`\n  \n![Kotlin other](intellij/intellij-kotlin-other.png)\n\nFor Kotlin, we use the default 140 character line length.\n\n### Manual XML Code Style\n\nGo to `Preferences/Settings \u003e Editor \u003e Code Style \u003e XML \u003e Tabs and Indents`:\n* Set `Tab size` to 2\n* Set `Indent` to 2\n* Set `Continuation indent` to 2\n\n![Intellij XML code style other](intellij/intellij-xml-indents.png)\nGo to `Preferences/Settings \u003e Editor \u003e Code Style \u003e XML \u003e Other`:\n* Set `Hard wrap at` to 140\n* Check `Keep line breaks in text`\n* Check `Keep white spaces`\n\n![Intellij XML code style other](intellij/intellij-xml-other.png)\n\n### Manual Groovy Code Style\n\nIn order to correctly format build.gradle files, code style for Groovy has to be set.\n\nGo to `Preferences/Settings \u003e Editor \u003e Code Style \u003e Groovy`:\n* Set `Tab size` to 2\n* Set `Indent` to 2\n* Set `Continuation indent` to 2\n\n![Intellij Groovy code style](intellij/intellij-groovy-indents.png)\n\n### Manual JavaScript/TypeScript Code Style\nFor Javascript (Typescript)\nGo to `Preferences/Settings \u003e Editor \u003e Code Style \u003e TypeScript \u003e Imports`:\n* Check `Sort imported members`\n* Check `Sort imports by modules`\n\n![Intellij typescript](intellij/intellij-typescript-imports.png)\n\nWe use a tool called **Prettier**. In order to ensure it functions correctly, install the [Prettier plugin](https://www.jetbrains.com/help/idea/prettier.html).\nOnce installed set the files as such:\n![Intellij javascript prettier](intellij/intellij-javascript-prettier.png)\n\nThe Prettier plugin requires IntelliJ Ultimate, but it's possible to use it without the plugin, e.g. [like this](https://github.com/SonarSource/sonar-developer-toolset/pull/32#issuecomment-1514574604).\n\nThen to make sure prettier is run correctly, modify the on save actions:\n![Intellij javascript onsave](intellij/intellij-javscript-actionsonsave.png)\n\n### Manual Scala Code Style\nInstall [Scala plugin](https://plugins.jetbrains.com/plugin/1347-scala) if not installed already\n\nGo to `Preferences/Settings \u003e Editor \u003e Code Style \u003e Scala \u003e Imports`:\n* Set `Class count to use import with '_'` to 999\n* Check `Merge imports with the same prefix into one statement`\n* Ensure to have the following `Import Layout` (it should be the default):\n\n![Intellij scala import layout](intellij/intellij-scala-import-layout.PNG)\n\n## (Optional) Build Configuration for Intellij\n\nIf the project uses maven, and you experience problems with the built-in build system (*Build* ➡️ *Rebuild Project*) like long build times or build failures, you should [delegate the build to maven](https://www.jetbrains.com/help/idea/delegate-build-and-run-actions-to-maven.html#delegate_to_maven). Make sure to skip tests during the build:\n\n![Intellij-maven-runner](intellij/intellij-maven-runner.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsonarsource%2Fsonar-developer-toolset","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsonarsource%2Fsonar-developer-toolset","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsonarsource%2Fsonar-developer-toolset/lists"}