diff --git a/packages/python-packages/api-stub-generator/CHANGELOG.md b/packages/python-packages/api-stub-generator/CHANGELOG.md index bb1d79ab845..b369407f1d0 100644 --- a/packages/python-packages/api-stub-generator/CHANGELOG.md +++ b/packages/python-packages/api-stub-generator/CHANGELOG.md @@ -2,6 +2,7 @@ ## Version 0.3.4 (Unreleased) Fixed issue so that APIView is still generated even if pylint parsing fails. +Fixed issue where diagnostics could be duplicated on functions with the same name. ## Version 0.3.3 (2022-08-03) Fixed issue in module order to get consistent order diff --git a/packages/python-packages/api-stub-generator/apistub/_diagnostic.py b/packages/python-packages/api-stub-generator/apistub/_diagnostic.py index be323786b1e..36917f9886f 100644 --- a/packages/python-packages/api-stub-generator/apistub/_diagnostic.py +++ b/packages/python-packages/api-stub-generator/apistub/_diagnostic.py @@ -21,7 +21,8 @@ class Diagnostic: id_counter = 1 def __init__(self, *, obj: "PylintError", target_id: str): - self.diagnostic_id = "AZ_PY_{}".format(Diagnostic.id_counter) + diagnostic_number = Diagnostic.id_counter + self.diagnostic_id = f"AZ_PY_{diagnostic_number}" Diagnostic.id_counter += 1 self.text = f"{obj.message} [{obj.symbol}]" self.help_link_uri = obj.help_link diff --git a/packages/python-packages/api-stub-generator/apistub/nodes/_function_node.py b/packages/python-packages/api-stub-generator/apistub/nodes/_function_node.py index 04dcf01ca3f..028b994faf5 100644 --- a/packages/python-packages/api-stub-generator/apistub/nodes/_function_node.py +++ b/packages/python-packages/api-stub-generator/apistub/nodes/_function_node.py @@ -65,7 +65,7 @@ def _regenerate_function_id(self): Regenerate the namespace_id for functions to account for overloads, which have the same name. """ - lines = [f"{self.name}("] + lines = [f"{self.full_name}("] for arg in self.args.values(): lines.append(f"{arg.argname}:{arg.argtype},") for arg in self.kwargs.values(): diff --git a/packages/python-packages/api-stub-generator/apiview_reqs.txt b/packages/python-packages/api-stub-generator/apiview_reqs.txt index 07c576bdd08..45ad91cf237 100644 --- a/packages/python-packages/api-stub-generator/apiview_reqs.txt +++ b/packages/python-packages/api-stub-generator/apiview_reqs.txt @@ -1,2 +1,2 @@ ./ -pylint-guidelines-checker==0.0.5 \ No newline at end of file +pylint-guidelines-checker==0.0.7 \ No newline at end of file