You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tooling.apache.org by sb...@apache.org on 2026/04/22 15:24:29 UTC
(tooling-trusted-releases) branch sbp updated: Update the underscore convention to align with practice
This is an automated email from the ASF dual-hosted git repository.
sbp pushed a commit to branch sbp
in repository https://gitbox.apache.org/repos/asf/tooling-trusted-releases.git
The following commit(s) were added to refs/heads/sbp by this push:
new 210ee7da Update the underscore convention to align with practice
210ee7da is described below
commit 210ee7da6f7feb92145ed1f9bdfb88f0ba4d8f9e
Author: Sean B. Palmer <se...@miscoranda.com>
AuthorDate: Wed Apr 22 16:23:53 2026 +0100
Update the underscore convention to align with practice
---
atr/blueprints/common.py | 6 +++---
atr/docs/code-conventions.md | 3 ++-
tests/unit/test_ssh_account_status.py | 4 ++--
3 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/atr/blueprints/common.py b/atr/blueprints/common.py
index 1dccc709..24d5de85 100644
--- a/atr/blueprints/common.py
+++ b/atr/blueprints/common.py
@@ -97,7 +97,7 @@ def build_path(
segments: list[str] = []
validated_params: list[tuple[str, type]] = []
literal_params: dict[str, str] = {}
- unique = _UniqueParams()
+ unique = UniqueParams()
for ix, param_name in enumerate(params):
hint = hints.get(param_name)
@@ -150,7 +150,7 @@ def build_api_path(
segments: list[str] = []
validated_params: list[tuple[str, type]] = []
literal_params: dict[str, str] = {}
- unique = _UniqueParams()
+ unique = UniqueParams()
optional_params: list[str] = []
for ix, param_name in enumerate(params):
@@ -312,7 +312,7 @@ def _parse_query_args(query_cls: type, args: Any) -> Any:
@dataclasses.dataclass
-class _UniqueParams:
+class UniqueParams:
"""Tracks the at-most-one body, form, and query parameters during path building."""
body: tuple[str, type[pydantic.BaseModel]] | None = None
diff --git a/atr/docs/code-conventions.md b/atr/docs/code-conventions.md
index 17e41fa9..b4127055 100644
--- a/atr/docs/code-conventions.md
+++ b/atr/docs/code-conventions.md
@@ -70,12 +70,13 @@ This includes triple quoted strings.
### Prefix private interfaces with a single underscore
-Prefix all private interfaces, e.g. functions, classes, constants, variables, with a single underscore. An interface is private when used exclusively within its containing module and not referenced by external code, templates, or processes.
+Prefix private interfaces, e.g. functions, constants, variables, with a single underscore. An interface is private when used exclusively within its containing module and not referenced by external code, templates, or processes.
Exceptions to this rule include:
* Type variables
* Enumerations
+* Classes
* Methods requiring interface compatibility with their superclass
* Nested functions (which should generally be avoided)
diff --git a/tests/unit/test_ssh_account_status.py b/tests/unit/test_ssh_account_status.py
index 849e02a2..0f42f2a7 100644
--- a/tests/unit/test_ssh_account_status.py
+++ b/tests/unit/test_ssh_account_status.py
@@ -200,7 +200,7 @@ async def test_validate_public_key_closes_db_session_before_ldap(monkeypatch: "M
return True
monkeypatch.setattr("atr.ldap.is_active", is_active)
- monkeypatch.setattr("atr.db.session", lambda: _WorkflowKeySession(mock_workflow_key, mark_session_closed))
+ monkeypatch.setattr("atr.db.session", lambda: WorkflowKeySession(mock_workflow_key, mark_session_closed))
result = await server.validate_public_key("github", key)
@@ -231,7 +231,7 @@ def _make_server() -> ssh.SSHServer:
return server
-class _WorkflowKeySession:
+class WorkflowKeySession:
def __init__(self, workflow_key: mock.MagicMock, on_exit):
self._workflow_key = workflow_key
self._on_exit = on_exit
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@tooling.apache.org
For additional commands, e-mail: commits-help@tooling.apache.org