Skip to content

Commit a18bd20

Browse files
Update rules metatada (#1675)
1 parent 194217b commit a18bd20

File tree

4 files changed

+19
-2
lines changed

4 files changed

+19
-2
lines changed

python-checks/src/main/resources/org/sonar/l10n/py/rules/python/S1172.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,19 @@ <h3>Exceptions</h3>
1616
def do_something(a, _): # no issue reported on _
1717
return compute(a)
1818
</pre>
19+
<p>The rule also won’t raise an issue if the parameter is referenced in a docstring or a comment:</p>
20+
<pre>
21+
class MyClass:
22+
def do_something(self, my_param): # no issue reported
23+
# Overrides may use my_param to ...
24+
return compute(a)
25+
</pre>
26+
<pre>
27+
class MyClass:
28+
def do_something(self, my_param): # no issue reported
29+
"""Overrides may use my_param to ..."""
30+
return compute(a)
31+
</pre>
1932
<h2>How to fix it</h2>
2033
<p>Having unused function parameters in your code can lead to confusion and misunderstanding of a developer’s intention. They reduce code readability
2134
and introduce the potential for errors. To avoid these problems, developers should remove unused parameters from function declarations.</p>

python-checks/src/main/resources/org/sonar/l10n/py/rules/python/S5659.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ <h4>Noncompliant code example</h4>
2222
<pre data-diff-id="1" data-diff-type="noncompliant">
2323
import jwt
2424

25-
jwt.decode(token, verify=False) # Noncompliant
25+
jwt.decode(token, options={"verify_signature":False}) # Noncompliant
2626
</pre>
2727
<h4>Compliant solution</h4>
2828
<p>By default, verification is enabled for the method <code>decode</code>.</p>

python-checks/src/main/resources/org/sonar/l10n/py/rules/python/Sonar_way_profile.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,12 @@
156156
"S5869",
157157
"S5886",
158158
"S5890",
159+
"S5899",
159160
"S5905",
161+
"S5906",
160162
"S5914",
163+
"S5915",
164+
"S5918",
161165
"S5994",
162166
"S5996",
163167
"S6001",

sonarpedia.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"languages": [
44
"PY"
55
],
6-
"latest-update": "2023-11-21T10:24:38.395541Z",
6+
"latest-update": "2023-12-04T08:58:08.586319Z",
77
"options": {
88
"no-language-in-filenames": true,
99
"preserve-filenames": true

0 commit comments

Comments
 (0)