Skip to content

Commit 8d2f2e2

Browse files
committed
test commit
Signed-off-by: Cagri Yonca <cagri@ibm.com>
1 parent 8b96412 commit 8d2f2e2

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

src/sample.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Missing copyright notice at the top of the file. (CPY rule violation)
2+
3+
import sys
4+
import os
5+
6+
def perform_calculations( name,age ):
7+
unused_variable = 100
8+
9+
# SIM (flake8-simplify) violation: Can directly 'return age >= 18'
10+
if age >= 18:
11+
is_adult = True
12+
else:
13+
is_adult = False
14+
15+
# UP031 (printf-string-formatting) violation: Uses '%' formatting
16+
old_style_message = "Hello %s" % name
17+
18+
# UP032 (f-string) violation: Uses '.format()'
19+
format_method_message = "Your age: {}".format(age)
20+
21+
# FLY (flynt) violation: Uses join() to concatenate static variables
22+
# Should use an f-string instead: f"{old_style_message} - {format_method_message}"
23+
result = " - ".join([old_style_message, format_method_message])
24+
25+
return result

0 commit comments

Comments
 (0)