-
-
Notifications
You must be signed in to change notification settings - Fork 0
fix(sonarcloud): declare all supported Python versions to Sonar #61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
williaby
wants to merge
1
commit into
main
Choose a base branch
from
claude/sonar-python-version-0
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: ByronWilliamsCPA/python-libs
Length of output: 683
🌐 Web query:
SonarQube for IDE sonar-project.properties properties applied sonarlint sonar.python.version💡 Result:
SonarLint for IDEs does not directly use the sonar-project.properties file to configure analysis parameters like sonar.python.version [1][2][3]. The sonar-project.properties file is designed specifically for SonarScanner CLI, which is used for full server-side analysis [1][3]. In SonarLint, the recommended way to manage configuration is through Connected Mode [4]. When you bind your IDE project to a project in SonarQube or SonarCloud, SonarLint retrieves the configuration (including quality profiles and rules) directly from the server [4][3]. This ensures that your IDE analysis remains consistent with the server-side analysis [3]. Regarding sonar.python.version specifically: - Purpose: This parameter informs the Python analyzer about the expected Python version to improve the accuracy of the analysis (e.g., standard library handling and symbol resolution) [5][6][7]. - Usage: It is intended for use in sonar-project.properties or via SonarScanner CLI during full analysis [6][8][9]. - SonarLint Behavior: SonarLint does not read this property from local configuration files [3]. If you are using Connected Mode, the server-side configuration should ideally handle the environment settings [3]. If you are not in Connected Mode, SonarLint relies on its internal default settings and does not currently support local overrides of this parameter via property files [1][2]. If you need to ensure consistency between your IDE and your CI analysis, the best practice is to ensure your project is properly bound in Connected Mode to your SonarQube/SonarCloud instance [4][3].
Citations:
🌐 Web query:
SonarLint Python 3.14 Sonar rule Python version support sonar.python.version💡 Result:
SonarLint and the broader Sonar ecosystem (including SonarQube Server and SonarQube Cloud) provide full support for Python 3.14 [1][2][3]. The support for Python 3.14 was introduced to enable analysis of new language features, including specific rules (such as S7931, S7941, S7942, S7943, and S7945) designed to ensure best practices when using Python 3.14 capabilities [4]. Regarding configuration, you can use the
sonar.python.versionparameter to specify the Python version(s) your project supports [1][3][5]. This helps the analyzer provide more precise results and silence irrelevant issues [1][6]. Key details forsonar.python.version: - Purpose: It allows you to define which Python versions are compatible with your code, ensuring the analysis is tailored to the correct language features [1][3]. - Format: It accepts a comma-separated list of versions in the "X.Y" format (e.g.,sonar.python.version=3.13, 3.14) [1][5][7]. - Usage: This parameter can be set in yoursonar-project.propertiesfile or provided via the CLI during analysis [1][5][6]. For IDE integration, including SonarLint, ensure your plugin is updated to the latest version to access the most recent rules and support for Python 3.14 [4].Citations:
Remove the SonarLint
sonar-project.propertiesclaim.sonar-project.propertiesis for SonarScanner runs, and SonarLint does not applysonar.python.versionfrom this file. Keep the CI value aligned, but remove “affects local and IDE (SonarLint) analysis” or document a supported connected-mode/IDE configuration instead.🤖 Prompt for AI Agents