Repository: pylint-dev/pylint

Issue:
# Options for wrong-import order ignored

### Bug description

```python
import six
import re  # Cause wrong-import-order
```

### Configuration

```ini

```

### Command used

```shell
pylint --disable=all --enable=C0411 --known-third-party=re /tmp/test.py
```

### Pylint output

```python
/tmp/test.py:2:0: C0411: standard import "re" should be placed before third party import "six" (wrong-import-order)
```

### Expected behavior

No error

### Pylint version

```shell
pylint 4.1.0-dev0
astroid 4.0.2
Python 3.10.13
```

### OS / Environment

_No response_

### Additional dependencies

```python

```

Implementation patch:
diff --git a/pylint/checkers/imports.py b/pylint/checkers/imports.py
index b069a7a0c6..b045f74c21 100644
--- a/pylint/checkers/imports.py
+++ b/pylint/checkers/imports.py
@@ -322,7 +322,6 @@ def _make_graph(
 DEFAULT_PREFERRED_MODULES = ()
 
 
-# pylint: disable-next = too-many-instance-attributes
 class ImportsChecker(DeprecatedMixin, BaseChecker):
     """BaseChecker for import statements.
 
@@ -459,15 +458,6 @@ def __init__(self, linter: PyLinter) -> None:
         )
         self._excluded_edges: defaultdict[str, set[str]] = defaultdict(set)
 
-        self._isort_config = isort.Config(
-            # There is no typo here. EXTRA_standard_library is
-            # what most users want. The option has been named
-            # KNOWN_standard_library for ages in pylint, and we
-            # don't want to break compatibility.
-            extra_standard_library=linter.config.known_standard_library,
-            known_third_party=linter.config.known_third_party,
-        )
-
     def open(self) -> None:
         """Called before visiting project (i.e set of modules)."""
         self.linter.stats.dependencies = {}
@@ -756,6 +746,21 @@ def _is_fallback_import(
         imports = [import_node for (import_node, _) in imports]
         return any(astroid.are_exclusive(import_node, node) for import_node in imports)
 
+    @property
+    def _isort_config(self) -> isort.Config:
+        """Get the config for use with isort.
+
+        Only valid after CLI parsing finished, i.e. not in __init__
+        """
+        return isort.Config(
+            # There is no typo here. EXTRA_standard_library is
+            # what most users want. The option has been named
+            # KNOWN_standard_library for ages in pylint, and we
+            # don't want to break compatibility.
+            extra_standard_library=self.linter.config.known_standard_library,
+            known_third_party=self.linter.config.known_third_party,
+        )
+
     def _check_imports_order(self, _module_node: nodes.Module) -> tuple[
         list[tuple[ImportNode, str]],
         list[tuple[ImportNode, str]],
@@ -763,7 +768,7 @@ def _check_imports_order(self, _module_node: nodes.Module) -> tuple[
     ]:
         """Checks imports of module `node` are grouped by category.
 
-        Imports must follow this order: standard, 3rd party, local
+        Imports must follow this order: standard, 3rd party, 1st party, local
         """
         std_imports: list[tuple[ImportNode, str]] = []
         third_party_imports: list[tuple[ImportNode, str]] = []
diff --git a/pylint/checkers/utils.py b/pylint/checkers/utils.py
index 7a45b472bd..5c44a8256e 100644
--- a/pylint/checkers/utils.py
+++ b/pylint/checkers/utils.py
@@ -6,7 +6,7 @@
 
 from __future__ import annotations
 
-import _string  # pylint: disable=wrong-import-order # Ruff and Isort disagree about the order here
+import _string
 import builtins
 import fnmatch
 import itertools


Test patch:
diff --git a/tests/functional/w/wrong_import_order2.py b/tests/functional/w/wrong_import_order2.py
index 7157512ddc..6f68906738 100644
--- a/tests/functional/w/wrong_import_order2.py
+++ b/tests/functional/w/wrong_import_order2.py
@@ -8,6 +8,7 @@
 
 # external imports
 import isort
+import datetime  # std import that should be treated as third-party
 
 from six import moves