Sort the list of sources in generated file headers

This commit is contained in:
Nat Noordanus 2020-10-19 18:31:37 +02:00 committed by Basileus
parent 2a73dbac98
commit fc90653ab1
2 changed files with 5 additions and 5 deletions

View File

@ -1,5 +1,5 @@
# Generated by the protocol buffer compiler. DO NOT EDIT! # Generated by the protocol buffer compiler. DO NOT EDIT!
# sources: google/protobuf/timestamp.proto, google/protobuf/field_mask.proto, google/protobuf/source_context.proto, google/protobuf/any.proto, google/protobuf/type.proto, google/protobuf/api.proto, google/protobuf/duration.proto, google/protobuf/struct.proto, google/protobuf/wrappers.proto, google/protobuf/empty.proto, google/protobuf/descriptor.proto # sources: google/protobuf/any.proto, google/protobuf/api.proto, google/protobuf/descriptor.proto, google/protobuf/duration.proto, google/protobuf/empty.proto, google/protobuf/field_mask.proto, google/protobuf/source_context.proto, google/protobuf/struct.proto, google/protobuf/timestamp.proto, google/protobuf/type.proto, google/protobuf/wrappers.proto
# plugin: python-betterproto # plugin: python-betterproto
import warnings import warnings
from dataclasses import dataclass from dataclasses import dataclass

View File

@ -58,7 +58,7 @@ from betterproto.lib.google.protobuf.compiler import CodeGeneratorRequest
import re import re
import textwrap import textwrap
from dataclasses import dataclass, field from dataclasses import dataclass, field
from typing import Dict, Iterator, List, Optional, Set, Text, Type, Union from typing import Dict, Iterable, Iterator, List, Optional, Set, Text, Type, Union
import sys import sys
from ..casing import sanitize_name from ..casing import sanitize_name
@ -251,15 +251,15 @@ class OutputTemplate:
return self.package_proto_obj.package return self.package_proto_obj.package
@property @property
def input_filenames(self) -> List[str]: def input_filenames(self) -> Iterable[str]:
"""Names of the input files used to build this output. """Names of the input files used to build this output.
Returns Returns
------- -------
List[str] Iterable[str]
Names of the input files used to build this output. Names of the input files used to build this output.
""" """
return [f.name for f in self.input_files] return sorted(f.name for f in self.input_files)
@property @property
def python_module_imports(self) -> Set[str]: def python_module_imports(self) -> Set[str]: