From 1c20b53bdc40764c7638ac07266de912c8f5d12e Mon Sep 17 00:00:00 2001 From: Yuriy Novostavskiy Date: Thu, 25 Jun 2026 20:00:33 +0200 Subject: [PATCH] ci: suppress SonarCloud python:S7498 for argument_spec dict() convention (#1152) Ansible module argument_spec is conventionally defined with the dict(...) constructor rather than {...} literals, for readability and consistency across the collection. SonarCloud's python:S7498 ("Literal syntax should be preferred...") flags this as a false positive and re-fires on every new module argument. Ignore the rule project-wide via sonar-project.properties. Fixes #1151 --- sonar-project.properties | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sonar-project.properties b/sonar-project.properties index 923aea25..c0b5d474 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -12,3 +12,11 @@ sonar.python.version=3.12 sonar.newCode.referenceBranch=main sonar.exclusions=tests/**,.tox/** + +# Ansible module argument_spec is conventionally defined with the dict(...) +# constructor (not {...} literals) for readability and consistency across the +# collection. Suppress python:S7498 ("prefer literal syntax"), which conflicts +# with that convention and otherwise re-fires on every new module argument. +sonar.issue.ignore.multicriteria=e1 +sonar.issue.ignore.multicriteria.e1.ruleKey=python:S7498 +sonar.issue.ignore.multicriteria.e1.resourceKey=**/*.py