Skip to content

Commit

Permalink
feature: Include full URL in docstring source links (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
aiven-anton authored Sep 10, 2023
1 parent d2dad64 commit eee5dc2
Show file tree
Hide file tree
Showing 572 changed files with 1,152 additions and 1 deletion.
11 changes: 10 additions & 1 deletion codegen/generate_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,15 @@
from .parser import PrimitiveField
from .parser import parse_file

schema_repository_source: Final = (
f"https://github.com/apache/kafka"
f"/tree/{build_tag}/clients/src/main/resources/common/message/"
)
imports_and_docstring: Final = '''\
"""
Generated from {schema_source}.
{schema_repository_source}{schema_source}
"""
# ruff: noqa: A003
Expand Down Expand Up @@ -535,7 +541,10 @@ def write_to_version_module(
with module_path.open("a") as fd:
if write_imports:
print(
imports_and_docstring.format(schema_source=schema_path.name),
imports_and_docstring.format(
schema_repository_source=schema_repository_source,
schema_source=schema_path.name,
),
file=fd,
)
print(get_header_schema_import(schema, version), file=fd)
Expand Down
2 changes: 2 additions & 0 deletions src/kio/schema/add_offsets_to_txn/v0/request.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""
Generated from AddOffsetsToTxnRequest.json.
https://github.com/apache/kafka/tree/3.5.1/clients/src/main/resources/common/message/AddOffsetsToTxnRequest.json
"""

# ruff: noqa: A003
Expand Down
2 changes: 2 additions & 0 deletions src/kio/schema/add_offsets_to_txn/v0/response.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""
Generated from AddOffsetsToTxnResponse.json.
https://github.com/apache/kafka/tree/3.5.1/clients/src/main/resources/common/message/AddOffsetsToTxnResponse.json
"""

# ruff: noqa: A003
Expand Down
2 changes: 2 additions & 0 deletions src/kio/schema/add_offsets_to_txn/v1/request.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""
Generated from AddOffsetsToTxnRequest.json.
https://github.com/apache/kafka/tree/3.5.1/clients/src/main/resources/common/message/AddOffsetsToTxnRequest.json
"""

# ruff: noqa: A003
Expand Down
2 changes: 2 additions & 0 deletions src/kio/schema/add_offsets_to_txn/v1/response.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""
Generated from AddOffsetsToTxnResponse.json.
https://github.com/apache/kafka/tree/3.5.1/clients/src/main/resources/common/message/AddOffsetsToTxnResponse.json
"""

# ruff: noqa: A003
Expand Down
2 changes: 2 additions & 0 deletions src/kio/schema/add_offsets_to_txn/v2/request.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""
Generated from AddOffsetsToTxnRequest.json.
https://github.com/apache/kafka/tree/3.5.1/clients/src/main/resources/common/message/AddOffsetsToTxnRequest.json
"""

# ruff: noqa: A003
Expand Down
2 changes: 2 additions & 0 deletions src/kio/schema/add_offsets_to_txn/v2/response.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""
Generated from AddOffsetsToTxnResponse.json.
https://github.com/apache/kafka/tree/3.5.1/clients/src/main/resources/common/message/AddOffsetsToTxnResponse.json
"""

# ruff: noqa: A003
Expand Down
2 changes: 2 additions & 0 deletions src/kio/schema/add_offsets_to_txn/v3/request.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""
Generated from AddOffsetsToTxnRequest.json.
https://github.com/apache/kafka/tree/3.5.1/clients/src/main/resources/common/message/AddOffsetsToTxnRequest.json
"""

# ruff: noqa: A003
Expand Down
2 changes: 2 additions & 0 deletions src/kio/schema/add_offsets_to_txn/v3/response.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""
Generated from AddOffsetsToTxnResponse.json.
https://github.com/apache/kafka/tree/3.5.1/clients/src/main/resources/common/message/AddOffsetsToTxnResponse.json
"""

# ruff: noqa: A003
Expand Down
2 changes: 2 additions & 0 deletions src/kio/schema/add_partitions_to_txn/v0/request.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""
Generated from AddPartitionsToTxnRequest.json.
https://github.com/apache/kafka/tree/3.5.1/clients/src/main/resources/common/message/AddPartitionsToTxnRequest.json
"""

# ruff: noqa: A003
Expand Down
2 changes: 2 additions & 0 deletions src/kio/schema/add_partitions_to_txn/v0/response.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""
Generated from AddPartitionsToTxnResponse.json.
https://github.com/apache/kafka/tree/3.5.1/clients/src/main/resources/common/message/AddPartitionsToTxnResponse.json
"""

# ruff: noqa: A003
Expand Down
2 changes: 2 additions & 0 deletions src/kio/schema/add_partitions_to_txn/v1/request.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""
Generated from AddPartitionsToTxnRequest.json.
https://github.com/apache/kafka/tree/3.5.1/clients/src/main/resources/common/message/AddPartitionsToTxnRequest.json
"""

# ruff: noqa: A003
Expand Down
2 changes: 2 additions & 0 deletions src/kio/schema/add_partitions_to_txn/v1/response.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""
Generated from AddPartitionsToTxnResponse.json.
https://github.com/apache/kafka/tree/3.5.1/clients/src/main/resources/common/message/AddPartitionsToTxnResponse.json
"""

# ruff: noqa: A003
Expand Down
2 changes: 2 additions & 0 deletions src/kio/schema/add_partitions_to_txn/v2/request.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""
Generated from AddPartitionsToTxnRequest.json.
https://github.com/apache/kafka/tree/3.5.1/clients/src/main/resources/common/message/AddPartitionsToTxnRequest.json
"""

# ruff: noqa: A003
Expand Down
2 changes: 2 additions & 0 deletions src/kio/schema/add_partitions_to_txn/v2/response.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""
Generated from AddPartitionsToTxnResponse.json.
https://github.com/apache/kafka/tree/3.5.1/clients/src/main/resources/common/message/AddPartitionsToTxnResponse.json
"""

# ruff: noqa: A003
Expand Down
2 changes: 2 additions & 0 deletions src/kio/schema/add_partitions_to_txn/v3/request.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""
Generated from AddPartitionsToTxnRequest.json.
https://github.com/apache/kafka/tree/3.5.1/clients/src/main/resources/common/message/AddPartitionsToTxnRequest.json
"""

# ruff: noqa: A003
Expand Down
2 changes: 2 additions & 0 deletions src/kio/schema/add_partitions_to_txn/v3/response.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""
Generated from AddPartitionsToTxnResponse.json.
https://github.com/apache/kafka/tree/3.5.1/clients/src/main/resources/common/message/AddPartitionsToTxnResponse.json
"""

# ruff: noqa: A003
Expand Down
2 changes: 2 additions & 0 deletions src/kio/schema/add_partitions_to_txn/v4/request.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""
Generated from AddPartitionsToTxnRequest.json.
https://github.com/apache/kafka/tree/3.5.1/clients/src/main/resources/common/message/AddPartitionsToTxnRequest.json
"""

# ruff: noqa: A003
Expand Down
2 changes: 2 additions & 0 deletions src/kio/schema/add_partitions_to_txn/v4/response.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""
Generated from AddPartitionsToTxnResponse.json.
https://github.com/apache/kafka/tree/3.5.1/clients/src/main/resources/common/message/AddPartitionsToTxnResponse.json
"""

# ruff: noqa: A003
Expand Down
2 changes: 2 additions & 0 deletions src/kio/schema/allocate_producer_ids/v0/request.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""
Generated from AllocateProducerIdsRequest.json.
https://github.com/apache/kafka/tree/3.5.1/clients/src/main/resources/common/message/AllocateProducerIdsRequest.json
"""

# ruff: noqa: A003
Expand Down
2 changes: 2 additions & 0 deletions src/kio/schema/allocate_producer_ids/v0/response.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""
Generated from AllocateProducerIdsResponse.json.
https://github.com/apache/kafka/tree/3.5.1/clients/src/main/resources/common/message/AllocateProducerIdsResponse.json
"""

# ruff: noqa: A003
Expand Down
2 changes: 2 additions & 0 deletions src/kio/schema/alter_client_quotas/v0/request.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""
Generated from AlterClientQuotasRequest.json.
https://github.com/apache/kafka/tree/3.5.1/clients/src/main/resources/common/message/AlterClientQuotasRequest.json
"""

# ruff: noqa: A003
Expand Down
2 changes: 2 additions & 0 deletions src/kio/schema/alter_client_quotas/v0/response.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""
Generated from AlterClientQuotasResponse.json.
https://github.com/apache/kafka/tree/3.5.1/clients/src/main/resources/common/message/AlterClientQuotasResponse.json
"""

# ruff: noqa: A003
Expand Down
2 changes: 2 additions & 0 deletions src/kio/schema/alter_client_quotas/v1/request.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""
Generated from AlterClientQuotasRequest.json.
https://github.com/apache/kafka/tree/3.5.1/clients/src/main/resources/common/message/AlterClientQuotasRequest.json
"""

# ruff: noqa: A003
Expand Down
2 changes: 2 additions & 0 deletions src/kio/schema/alter_client_quotas/v1/response.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""
Generated from AlterClientQuotasResponse.json.
https://github.com/apache/kafka/tree/3.5.1/clients/src/main/resources/common/message/AlterClientQuotasResponse.json
"""

# ruff: noqa: A003
Expand Down
2 changes: 2 additions & 0 deletions src/kio/schema/alter_configs/v0/request.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""
Generated from AlterConfigsRequest.json.
https://github.com/apache/kafka/tree/3.5.1/clients/src/main/resources/common/message/AlterConfigsRequest.json
"""

# ruff: noqa: A003
Expand Down
2 changes: 2 additions & 0 deletions src/kio/schema/alter_configs/v0/response.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""
Generated from AlterConfigsResponse.json.
https://github.com/apache/kafka/tree/3.5.1/clients/src/main/resources/common/message/AlterConfigsResponse.json
"""

# ruff: noqa: A003
Expand Down
2 changes: 2 additions & 0 deletions src/kio/schema/alter_configs/v1/request.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""
Generated from AlterConfigsRequest.json.
https://github.com/apache/kafka/tree/3.5.1/clients/src/main/resources/common/message/AlterConfigsRequest.json
"""

# ruff: noqa: A003
Expand Down
2 changes: 2 additions & 0 deletions src/kio/schema/alter_configs/v1/response.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""
Generated from AlterConfigsResponse.json.
https://github.com/apache/kafka/tree/3.5.1/clients/src/main/resources/common/message/AlterConfigsResponse.json
"""

# ruff: noqa: A003
Expand Down
2 changes: 2 additions & 0 deletions src/kio/schema/alter_configs/v2/request.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""
Generated from AlterConfigsRequest.json.
https://github.com/apache/kafka/tree/3.5.1/clients/src/main/resources/common/message/AlterConfigsRequest.json
"""

# ruff: noqa: A003
Expand Down
2 changes: 2 additions & 0 deletions src/kio/schema/alter_configs/v2/response.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""
Generated from AlterConfigsResponse.json.
https://github.com/apache/kafka/tree/3.5.1/clients/src/main/resources/common/message/AlterConfigsResponse.json
"""

# ruff: noqa: A003
Expand Down
2 changes: 2 additions & 0 deletions src/kio/schema/alter_partition/v0/request.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""
Generated from AlterPartitionRequest.json.
https://github.com/apache/kafka/tree/3.5.1/clients/src/main/resources/common/message/AlterPartitionRequest.json
"""

# ruff: noqa: A003
Expand Down
2 changes: 2 additions & 0 deletions src/kio/schema/alter_partition/v0/response.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""
Generated from AlterPartitionResponse.json.
https://github.com/apache/kafka/tree/3.5.1/clients/src/main/resources/common/message/AlterPartitionResponse.json
"""

# ruff: noqa: A003
Expand Down
2 changes: 2 additions & 0 deletions src/kio/schema/alter_partition/v1/request.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""
Generated from AlterPartitionRequest.json.
https://github.com/apache/kafka/tree/3.5.1/clients/src/main/resources/common/message/AlterPartitionRequest.json
"""

# ruff: noqa: A003
Expand Down
2 changes: 2 additions & 0 deletions src/kio/schema/alter_partition/v1/response.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""
Generated from AlterPartitionResponse.json.
https://github.com/apache/kafka/tree/3.5.1/clients/src/main/resources/common/message/AlterPartitionResponse.json
"""

# ruff: noqa: A003
Expand Down
2 changes: 2 additions & 0 deletions src/kio/schema/alter_partition/v2/request.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""
Generated from AlterPartitionRequest.json.
https://github.com/apache/kafka/tree/3.5.1/clients/src/main/resources/common/message/AlterPartitionRequest.json
"""

# ruff: noqa: A003
Expand Down
2 changes: 2 additions & 0 deletions src/kio/schema/alter_partition/v2/response.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""
Generated from AlterPartitionResponse.json.
https://github.com/apache/kafka/tree/3.5.1/clients/src/main/resources/common/message/AlterPartitionResponse.json
"""

# ruff: noqa: A003
Expand Down
2 changes: 2 additions & 0 deletions src/kio/schema/alter_partition/v3/request.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""
Generated from AlterPartitionRequest.json.
https://github.com/apache/kafka/tree/3.5.1/clients/src/main/resources/common/message/AlterPartitionRequest.json
"""

# ruff: noqa: A003
Expand Down
2 changes: 2 additions & 0 deletions src/kio/schema/alter_partition/v3/response.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""
Generated from AlterPartitionResponse.json.
https://github.com/apache/kafka/tree/3.5.1/clients/src/main/resources/common/message/AlterPartitionResponse.json
"""

# ruff: noqa: A003
Expand Down
2 changes: 2 additions & 0 deletions src/kio/schema/alter_partition_reassignments/v0/request.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""
Generated from AlterPartitionReassignmentsRequest.json.
https://github.com/apache/kafka/tree/3.5.1/clients/src/main/resources/common/message/AlterPartitionReassignmentsRequest.json
"""

# ruff: noqa: A003
Expand Down
2 changes: 2 additions & 0 deletions src/kio/schema/alter_partition_reassignments/v0/response.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""
Generated from AlterPartitionReassignmentsResponse.json.
https://github.com/apache/kafka/tree/3.5.1/clients/src/main/resources/common/message/AlterPartitionReassignmentsResponse.json
"""

# ruff: noqa: A003
Expand Down
2 changes: 2 additions & 0 deletions src/kio/schema/alter_replica_log_dirs/v0/request.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""
Generated from AlterReplicaLogDirsRequest.json.
https://github.com/apache/kafka/tree/3.5.1/clients/src/main/resources/common/message/AlterReplicaLogDirsRequest.json
"""

# ruff: noqa: A003
Expand Down
2 changes: 2 additions & 0 deletions src/kio/schema/alter_replica_log_dirs/v0/response.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""
Generated from AlterReplicaLogDirsResponse.json.
https://github.com/apache/kafka/tree/3.5.1/clients/src/main/resources/common/message/AlterReplicaLogDirsResponse.json
"""

# ruff: noqa: A003
Expand Down
2 changes: 2 additions & 0 deletions src/kio/schema/alter_replica_log_dirs/v1/request.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""
Generated from AlterReplicaLogDirsRequest.json.
https://github.com/apache/kafka/tree/3.5.1/clients/src/main/resources/common/message/AlterReplicaLogDirsRequest.json
"""

# ruff: noqa: A003
Expand Down
2 changes: 2 additions & 0 deletions src/kio/schema/alter_replica_log_dirs/v1/response.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""
Generated from AlterReplicaLogDirsResponse.json.
https://github.com/apache/kafka/tree/3.5.1/clients/src/main/resources/common/message/AlterReplicaLogDirsResponse.json
"""

# ruff: noqa: A003
Expand Down
2 changes: 2 additions & 0 deletions src/kio/schema/alter_replica_log_dirs/v2/request.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""
Generated from AlterReplicaLogDirsRequest.json.
https://github.com/apache/kafka/tree/3.5.1/clients/src/main/resources/common/message/AlterReplicaLogDirsRequest.json
"""

# ruff: noqa: A003
Expand Down
2 changes: 2 additions & 0 deletions src/kio/schema/alter_replica_log_dirs/v2/response.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""
Generated from AlterReplicaLogDirsResponse.json.
https://github.com/apache/kafka/tree/3.5.1/clients/src/main/resources/common/message/AlterReplicaLogDirsResponse.json
"""

# ruff: noqa: A003
Expand Down
Loading

0 comments on commit eee5dc2

Please sign in to comment.