@@ -52,14 +52,15 @@ def collect(self, identifier: str, config: dict) -> CollectorItem: # noqa: WPS2
|
52 | 52 | final_config = ChainMap(config, self.default_config) |
53 | 53 | parser_name = final_config["docstring_style"] |
54 | 54 | parser_options = final_config["docstring_options"] |
| 55 | +parser = parser_name and Parser(parser_name) |
55 | 56 | |
56 | 57 | just_loaded = False |
57 | 58 | module_name = identifier.split(".", 1)[0] |
58 | 59 | if module_name not in self._modules_collection: |
59 | 60 | just_loaded = True |
60 | 61 | loader = GriffeLoader( |
61 | 62 | extensions=load_extensions(final_config.get("extensions", [])), |
62 | | -docstring_parser=Parser(parser_name), |
| 63 | +docstring_parser=parser, |
63 | 64 | docstring_options=parser_options, |
64 | 65 | modules_collection=self._modules_collection, |
65 | 66 | lines_collection=self._lines_collection, |
@@ -79,7 +80,7 @@ def collect(self, identifier: str, config: dict) -> CollectorItem: # noqa: WPS2
|
79 | 80 | raise CollectionError(f"{identifier} could not be found") from error |
80 | 81 | |
81 | 82 | if not just_loaded and doc_object.docstring is not None: |
82 | | -doc_object.docstring.parser = parser_name and Parser(parser_name) |
| 83 | +doc_object.docstring.parser = parser |
83 | 84 | doc_object.docstring.parser_options = parser_options |
84 | 85 | |
85 | 86 | return doc_object |