You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -1702,15 +1702,23 @@ Flake8_ is an extensible linter framework for Python.
1702
1702
For more details, see the section :ref:`Linting with Flake8`.
1703
1703
1704
1704
1705
-
The reorder-python-imports hook
1706
-
-------------------------------
1705
+
The isort hook
1706
+
--------------
1707
1707
1708
-
reorder-python-imports_ sorts imports in your Python code.
1708
+
isort_ reorders imports in your Python code.
1709
1709
Imports are separated into three sections,
1710
1710
as recommended by `PEP 8`_: standard library, third party, first party.
1711
-
The tool also splits ``from`` imports onto separate lines to avoid merge conflicts,
1712
-
and moves them after normal imports.
1713
-
Any duplicate imports are removed.
1711
+
There are two additional sections,
1712
+
one at the top for `future imports <https://docs.python.org/3/library/__future__.html>`__,
1713
+
the other at the bottom for `relative imports <https://docs.python.org/3/reference/import.html#package-relative-imports>`__.
1714
+
Within each section, ``from`` imports follow normal imports.
1715
+
Imports are then sorted alphabetically.
1716
+
1717
+
The |HPC| activates the `Black profile <https://pycqa.github.io/isort/docs/configuration/black_compatibility.html>`__ for compatibility with the Black code formatter.
1718
+
Furthermore, the `force_single_line <https://pycqa.github.io/isort/docs/configuration/options.html#force-single-line>`__ setting is enabled.
1719
+
This splits imports onto separate lines to avoid merge conflicts.
1720
+
Finally, two blank lines are enforced after imports for consistency,
1721
+
via the `lines_after_imports <https://pycqa.github.io/isort/docs/configuration/options.html#lines-after-imports>`__ setting.
0 commit comments