mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 22:51:17 +07:00
Optimize imports now differentiate between "bound" and "unbound" comments interleaving import statements. The former immediately precede the import after them without any blank lines between them, while all the rest are considered the latter, "unbound", comments which are grouped and inserted after the whole import block. It allows to handle the comments before the first import more accurately, moving comments like "# noinspection" as expected, yet leaving licenses, shebangs and encoding declarations in place if they are separated with a blank line. Additionally, this is almost identical to the way "isort" utility handles line comments.
24 lines
763 B
Python
24 lines
763 B
Python
#!/usr/bin/python
|
|
# Copyright 2000-2017 JetBrains s.r.o.
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
|
|
# noinspection PyUnresolvedReferences
|
|
import unresolved
|
|
from lib import a
|
|
from lib import b
|
|
# specific for import from sys
|
|
from sys import path
|
|
|
|
print(a, b, path)
|