fix(python): better try-except indentation (#6097)

This commit is contained in:
Riley Bruins 2024-02-14 09:39:59 -08:00 committed by GitHub
parent 5a5cabd712
commit d96bf9d522
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 21 additions and 2 deletions

View file

@ -38,8 +38,19 @@
(ERROR
"try"
":" @indent.begin
(#set! indent.immediate 1))
.
":"
(#set! indent.immediate 1)) @indent.begin
(ERROR
"try"
.
":"
(ERROR
(block
(expression_statement
(identifier) @_except) @indent.branch))
(#eq? @_except "except"))
((function_definition) @indent.begin
(#set! indent.immediate 1))