mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-05 19:46:54 +00:00
Open source check-indent to auto-yelpdent.
This commit is contained in:
parent
35548254ad
commit
7f9dde14f0
9 changed files with 451 additions and 2 deletions
|
|
@ -0,0 +1,62 @@
|
|||
# bad
|
||||
def foo(
|
||||
a,
|
||||
b,
|
||||
c,
|
||||
*args,
|
||||
**kwargs
|
||||
):
|
||||
pass
|
||||
|
||||
# okay
|
||||
def bar():
|
||||
pass
|
||||
|
||||
# bad
|
||||
_ = foo(
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
4,
|
||||
e=5,
|
||||
*[],
|
||||
**{}
|
||||
)
|
||||
|
||||
# okay
|
||||
_ = bar()
|
||||
|
||||
# okay
|
||||
_ = foo(bar, baz, womp)
|
||||
|
||||
# bad
|
||||
class baz(
|
||||
object,
|
||||
object,
|
||||
):
|
||||
pass
|
||||
|
||||
# okay
|
||||
class qux:
|
||||
pass
|
||||
|
||||
# bad
|
||||
_ = foo(
|
||||
foo(
|
||||
1 + foo(
|
||||
1, # trickier
|
||||
2,
|
||||
3,
|
||||
),
|
||||
4,
|
||||
5,
|
||||
),
|
||||
6,
|
||||
7,
|
||||
)
|
||||
|
||||
# bad
|
||||
_ = '(wow)'.foo(
|
||||
no,
|
||||
way,
|
||||
)
|
||||
55
testing/resources/auto_indent/file_with_bad_indentation
Normal file
55
testing/resources/auto_indent/file_with_bad_indentation
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
# bad
|
||||
def foo(a,
|
||||
b,
|
||||
c,
|
||||
*args,
|
||||
**kwargs
|
||||
):
|
||||
pass
|
||||
|
||||
# okay
|
||||
def bar():
|
||||
pass
|
||||
|
||||
# bad
|
||||
_ = foo(1,
|
||||
2,
|
||||
3,
|
||||
4,
|
||||
e=5,
|
||||
*[],
|
||||
**{}
|
||||
)
|
||||
|
||||
# okay
|
||||
_ = bar()
|
||||
|
||||
# okay
|
||||
_ = foo(bar, baz, womp)
|
||||
|
||||
# bad
|
||||
class baz(object,
|
||||
object,
|
||||
):
|
||||
pass
|
||||
|
||||
# okay
|
||||
class qux:
|
||||
pass
|
||||
|
||||
# bad
|
||||
_ = foo(foo(1 + foo(1, # trickier
|
||||
2,
|
||||
3,
|
||||
),
|
||||
4,
|
||||
5,
|
||||
),
|
||||
6,
|
||||
7,
|
||||
)
|
||||
|
||||
# bad
|
||||
_ = '(wow)'.foo(no,
|
||||
way,
|
||||
)
|
||||
61
testing/resources/auto_indent/file_with_partial_indentation
Normal file
61
testing/resources/auto_indent/file_with_partial_indentation
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
# bad
|
||||
def foo(a,
|
||||
b,
|
||||
c,
|
||||
*args,
|
||||
**kwargs
|
||||
):
|
||||
pass
|
||||
|
||||
# okay
|
||||
def bar():
|
||||
pass
|
||||
|
||||
# bad
|
||||
_ = foo(
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
4,
|
||||
e=5,
|
||||
*[],
|
||||
**{}
|
||||
)
|
||||
|
||||
# okay
|
||||
_ = bar()
|
||||
|
||||
# okay
|
||||
_ = foo(bar, baz, womp)
|
||||
|
||||
# bad
|
||||
class baz(
|
||||
object,
|
||||
object,
|
||||
):
|
||||
pass
|
||||
|
||||
# okay
|
||||
class qux:
|
||||
pass
|
||||
|
||||
# bad
|
||||
_ = foo(
|
||||
foo(
|
||||
1 + foo(
|
||||
1, # trickier
|
||||
2,
|
||||
3,
|
||||
),
|
||||
4,
|
||||
5,
|
||||
),
|
||||
6,
|
||||
7,
|
||||
)
|
||||
|
||||
# bad
|
||||
_ = '(wow)'.foo(
|
||||
no,
|
||||
way,
|
||||
)
|
||||
4
testing/resources/auto_indent/syntax_error
Normal file
4
testing/resources/auto_indent/syntax_error
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
def foo(a,
|
||||
b,
|
||||
)
|
||||
pass
|
||||
Loading…
Add table
Add a link
Reference in a new issue