Title: feat: add extra-properties support for SonarQube config generation by harell · Pull Request #1926 · usethis-python/usethis-python · GitHub
Open Graph Title: feat: add extra-properties support for SonarQube config generation by harell · Pull Request #1926 · usethis-python/usethis-python
X Title: feat: add extra-properties support for SonarQube config generation by harell · Pull Request #1926 · usethis-python/usethis-python
Description: What Adds support for tool.usethis.sonarqube.extra-properties in pyproject.toml, allowing users to pass through arbitrary sonar.* properties when generating sonar-project.properties via usethis show sonarqube. Why SonarQube's scanner supports a large number of analysis properties beyond what usethis currently manages. Some of these are needed to import results from external analyzers — tools that run outside SonarQube but whose findings you want to see alongside SonarQube's own analysis. For example, many Python projects run Ruff as their primary linter. Since SonarQube 10.1 (August 2023), the scanner can import Ruff results via the sonar.python.ruff.reportPaths property. Similarly, projects may want to import Pylint reports (sonar.python.pylint.reportPaths), Bandit results (sonar.python.bandit.reportPaths), or Mypy findings (sonar.python.mypy.reportPaths). Without this change, the only way to use these properties with usethis is to create a static sonar-project.properties file — which defeats the purpose of having usethis generate it dynamically from pyproject.toml. How it works Users add a [tool.usethis.sonarqube.extra-properties] table to their pyproject.toml: [tool.usethis.sonarqube] project-key = "my-project" [tool.usethis.sonarqube.extra-properties] "sonar.python.ruff.reportPaths" = "ruff-report.json" "sonar.python.bandit.reportPaths" = "bandit-report.json" Running usethis show sonarqube then produces: sonar.projectKey=my-project sonar.language=py sonar.python.version=3.12 sonar.sources=./src sonar.tests=./tests sonar.python.coverage.reportPaths=coverage.xml sonar.verbose=false sonar.python.bandit.reportPaths=bandit-report.json sonar.python.ruff.reportPaths=ruff-report.json Extra properties are appended after all managed properties, in sorted order for deterministic output. If extra-properties is absent or empty, the output is unchanged (fully backward compatible). Changes src/usethis/_integrations/sonarqube/config.py: Added _get_sonarqube_extra_properties() function and integrated it into get_sonar_project_properties(). tests/usethis/_integrations/sonarqube/test_sonarqube_config.py: Added 3 tests — single property, multiple properties (verifying sort order), and absent extra-properties (backward compat). docs/cli/reference.md: Documented the new configuration key.
Open Graph Description: What Adds support for tool.usethis.sonarqube.extra-properties in pyproject.toml, allowing users to pass through arbitrary sonar.* properties when generating sonar-project.properties via usethis sho...
X Description: What Adds support for tool.usethis.sonarqube.extra-properties in pyproject.toml, allowing users to pass through arbitrary sonar.* properties when generating sonar-project.properties via usethis sho...
Opengraph URL: https://github.com/usethis-python/usethis-python/pull/1926
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:8807cd68-0ad3-b9bb-fe45-536b7118f6c6 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | D49A:1E086E:15D22A9:1FD5D03:6A4E49F4 |
| html-safe-nonce | 78a8023f97b9d03581e59867710ce5d6f9964ab0aca3add80bbdfda45c4b82cf |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENDlBOjFFMDg2RToxNUQyMkE5OjFGRDVEMDM6NkE0RTQ5RjQiLCJ2aXNpdG9yX2lkIjoiODc3NjQ3OTMyOTk4NDg1ODYxMiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | b00676f10009896132819fac7376b069d1d40bfffaa01902a57d8e171a62df68 |
| hovercard-subject-tag | pull_request:3640009286 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/usethis-python/usethis-python/pull/1926/files |
| twitter:image | https://avatars.githubusercontent.com/u/7226303?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/7226303?s=400&v=4 |
| og:image:alt | What Adds support for tool.usethis.sonarqube.extra-properties in pyproject.toml, allowing users to pass through arbitrary sonar.* properties when generating sonar-project.properties via usethis sho... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 030096ee0db095447bfe77409d33bfac127ca7128299c58deef27c52eaa1b1f0 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/usethis-python/usethis-python git https://github.com/usethis-python/usethis-python.git |
| octolytics-dimension-user_id | 216362695 |
| octolytics-dimension-user_login | usethis-python |
| octolytics-dimension-repository_id | 842189705 |
| octolytics-dimension-repository_nwo | usethis-python/usethis-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 842189705 |
| octolytics-dimension-repository_network_root_nwo | usethis-python/usethis-python |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | e8506f6d0538364886e3f0153c154c410965e70d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width