Skip to content

Commit d770c69

Browse files
authored
Fix fully_qualified should be typehints_fully_qualified (#204)
1 parent 87759d4 commit d770c69

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 1.15.1
4+
5+
- Fix `fully_qualified` should be `typehints_fully_qualified`
6+
37
## 1.15.0
48

59
- Resolve type guard imports before evaluating annotations for objects

src/sphinx_autodoc_typehints/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def format_annotation(annotation: Any, config: Config) -> str:
121121
module = "typing"
122122

123123
full_name = f"{module}.{class_name}" if module != "builtins" else class_name
124-
fully_qualified: bool = getattr(config, "fully_qualified", False)
124+
fully_qualified: bool = getattr(config, "typehints_fully_qualified", False)
125125
prefix = "" if fully_qualified or full_name == class_name else "~"
126126
role = "data" if class_name in _PYDATA_ANNOTATIONS else "class"
127127
args_format = "\\[{}]"

tests/test_sphinx_autodoc_typehints.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,14 +221,14 @@ def test_format_annotation(inv: Inventory, annotation: Any, expected_result: str
221221
# Test with the "fully_qualified" flag turned on
222222
if "typing" in expected_result_not_simplified:
223223
expected_result_not_simplified = expected_result_not_simplified.replace("~typing", "typing")
224-
conf = create_autospec(Config, fully_qualified=True, simplify_optional_unions=False)
224+
conf = create_autospec(Config, typehints_fully_qualified=True, simplify_optional_unions=False)
225225
assert format_annotation(annotation, conf) == expected_result_not_simplified
226226

227227
# Test with the "fully_qualified" flag turned on
228228
if "typing" in expected_result or __name__ in expected_result:
229229
expected_result = expected_result.replace("~typing", "typing")
230230
expected_result = expected_result.replace("~" + __name__, __name__)
231-
conf = create_autospec(Config, fully_qualified=True)
231+
conf = create_autospec(Config, typehints_fully_qualified=True)
232232
assert format_annotation(annotation, conf) == expected_result
233233

234234
# Test for the correct role (class vs data) using the official Sphinx inventory

0 commit comments

Comments
 (0)