-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Two blank lines after an import should be reduced to one (#4489)
Co-authored-by: Jelle Zijlstra <[email protected]>
- Loading branch information
1 parent
96ca1b6
commit e54f86b
Showing
7 changed files
with
195 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,180 @@ | ||
# flags: --preview | ||
from middleman.authentication import validate_oauth_token | ||
|
||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
# case 2 comment after import | ||
from middleman.authentication import validate_oauth_token | ||
#comment | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
# case 3 comment after import | ||
from middleman.authentication import validate_oauth_token | ||
# comment | ||
logger = logging.getLogger(__name__) | ||
|
||
|
||
from middleman.authentication import validate_oauth_token | ||
|
||
|
||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
# case 4 try catch with import after import | ||
import os | ||
import os | ||
|
||
|
||
|
||
try: | ||
import os | ||
except Exception: | ||
pass | ||
|
||
try: | ||
import os | ||
def func(): | ||
a = 1 | ||
except Exception: | ||
pass | ||
|
||
|
||
# case 5 multiple imports | ||
import os | ||
import os | ||
|
||
import os | ||
import os | ||
|
||
|
||
|
||
|
||
|
||
for i in range(10): | ||
print(i) | ||
|
||
|
||
# case 6 import in function | ||
def func(): | ||
print() | ||
import os | ||
def func(): | ||
pass | ||
print() | ||
|
||
|
||
def func(): | ||
import os | ||
a = 1 | ||
print() | ||
|
||
|
||
def func(): | ||
import os | ||
|
||
|
||
a = 1 | ||
print() | ||
|
||
|
||
def func(): | ||
import os | ||
|
||
|
||
|
||
a = 1 | ||
print() | ||
|
||
# output | ||
|
||
|
||
from middleman.authentication import validate_oauth_token | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
# case 2 comment after import | ||
from middleman.authentication import validate_oauth_token | ||
|
||
# comment | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
# case 3 comment after import | ||
from middleman.authentication import validate_oauth_token | ||
|
||
# comment | ||
logger = logging.getLogger(__name__) | ||
|
||
|
||
from middleman.authentication import validate_oauth_token | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
# case 4 try catch with import after import | ||
import os | ||
import os | ||
|
||
try: | ||
import os | ||
except Exception: | ||
pass | ||
|
||
try: | ||
import os | ||
|
||
def func(): | ||
a = 1 | ||
|
||
except Exception: | ||
pass | ||
|
||
|
||
# case 5 multiple imports | ||
import os | ||
import os | ||
|
||
import os | ||
import os | ||
|
||
for i in range(10): | ||
print(i) | ||
|
||
|
||
# case 6 import in function | ||
def func(): | ||
print() | ||
import os | ||
|
||
def func(): | ||
pass | ||
|
||
print() | ||
|
||
|
||
def func(): | ||
import os | ||
|
||
a = 1 | ||
print() | ||
|
||
|
||
def func(): | ||
import os | ||
|
||
a = 1 | ||
print() | ||
|
||
|
||
def func(): | ||
import os | ||
|
||
a = 1 | ||
print() |