Skip to content

Commit 65c9cec

Browse files
Flake8 showcase
1 parent ef04b8d commit 65c9cec

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

flake8/.flake8

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[flake8]
2+
max-line-length = 88
3+
extend-ignore = E203, W503
4+

flake8/example.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import os, sys # F401: sys imported but unused
2+
3+
def my_function( x, y ):
4+
print( "Result:",x+y ) # E201, E202, E231, E221
5+
6+
class myclass: # N801: class name should use CapWords convention
7+
def __init__(self):
8+
self.value =42 # E225: missing whitespace around operator
9+
10+
def doSomething(self): # N802: function name should be snake_case
11+
if( self.value>0 ):
12+
print("Positive")
13+
else:
14+
print( "Not positive" )
15+
16+
my_function(1,2)

0 commit comments

Comments
 (0)