Skip to content

Commit

Permalink
Use pragma single-line
Browse files Browse the repository at this point in the history
Summary: Use `pragma single-line` suppressing all newlines in the current partial.

Reviewed By: createdbysk

Differential Revision: D67612065

fbshipit-source-id: e9521febea03e68e66700902a5ecc9773e408773
  • Loading branch information
yoney authored and facebook-github-bot committed Dec 24, 2024
1 parent 9069856 commit ab8506c
Show file tree
Hide file tree
Showing 10 changed files with 90 additions and 70 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@
}}{{!
This is the base class for Thrift exception
}}{{#program:generate_mutable_types}}{{!
}}_fbthrift_python_mutable_exceptions.MutableGeneratedError{{!
}}{{/program:generate_mutable_types}}{{!
}}{{#program:generate_immutable_types}}{{!
}}_fbthrift_python_exceptions.GeneratedError{{!
}}{{/program:generate_immutable_types}}
}}
{{#pragma single-line}}
{{#program:generate_mutable_types}}
_fbthrift_python_mutable_exceptions.MutableGeneratedError
{{/program:generate_mutable_types}}
{{#program:generate_immutable_types}}
_fbthrift_python_exceptions.GeneratedError
{{/program:generate_immutable_types}}
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@
}}{{!
This is the metaclass for Thrift exception
}}{{#program:generate_mutable_types}}{{!
}}_fbthrift_python_mutable_exceptions.MutableGeneratedErrorMeta{{!
}}{{/program:generate_mutable_types}}{{!
}}{{#program:generate_immutable_types}}{{!
}}_fbthrift_python_exceptions.GeneratedErrorMeta{{!
}}{{/program:generate_immutable_types}}
}}
{{#pragma single-line}}
{{#program:generate_mutable_types}}
_fbthrift_python_mutable_exceptions.MutableGeneratedErrorMeta
{{/program:generate_mutable_types}}
{{#program:generate_immutable_types}}
_fbthrift_python_exceptions.GeneratedErrorMeta
{{/program:generate_immutable_types}}
20 changes: 11 additions & 9 deletions thrift/compiler/generate/templates/python/types/mapping.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@
}}{{!
This is import module for abstract, mutable, and immutable mappings
}}{{#program:generate_abstract_types}}{{!
}}_typing.Mapping{{!
}}{{/program:generate_abstract_types}}{{!
}}{{#program:generate_mutable_types}}{{!
}}_fbthrift_python_mutable_containers.MutableMap{{!
}}{{/program:generate_mutable_types}}{{!
}}{{#program:generate_immutable_types}}{{!
}}_typing.Mapping{{!
}}{{/program:generate_immutable_types}}
}}
{{#pragma single-line}}
{{#program:generate_abstract_types}}
_typing.Mapping
{{/program:generate_abstract_types}}
{{#program:generate_mutable_types}}
_fbthrift_python_mutable_containers.MutableMap
{{/program:generate_mutable_types}}
{{#program:generate_immutable_types}}
_typing.Mapping
{{/program:generate_immutable_types}}
20 changes: 11 additions & 9 deletions thrift/compiler/generate/templates/python/types/sequence.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@
}}{{!
This is import module for abstract, mutable, and immutable sequences
}}{{#program:generate_abstract_types}}{{!
}}_typing.Sequence{{!
}}{{/program:generate_abstract_types}}{{!
}}{{#program:generate_mutable_types}}{{!
}}_fbthrift_python_mutable_containers.MutableList{{!
}}{{/program:generate_mutable_types}}{{!
}}{{#program:generate_immutable_types}}{{!
}}_typing.Sequence{{!
}}{{/program:generate_immutable_types}}
}}
{{#pragma single-line}}
{{#program:generate_abstract_types}}
_typing.Sequence
{{/program:generate_abstract_types}}
{{#program:generate_mutable_types}}
_fbthrift_python_mutable_containers.MutableList
{{/program:generate_mutable_types}}
{{#program:generate_immutable_types}}
_typing.Sequence
{{/program:generate_immutable_types}}
20 changes: 11 additions & 9 deletions thrift/compiler/generate/templates/python/types/set.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@
}}{{!
This is import module for abstract, mutable, and immutable sets
}}{{#program:generate_abstract_types}}{{!
}}_typing.AbstractSet{{!
}}{{/program:generate_abstract_types}}{{!
}}{{#program:generate_mutable_types}}{{!
}}_fbthrift_python_mutable_containers.MutableSet{{!
}}{{/program:generate_mutable_types}}{{!
}}{{#program:generate_immutable_types}}{{!
}}_typing.AbstractSet{{!
}}{{/program:generate_immutable_types}}
}}
{{#pragma single-line}}
{{#program:generate_abstract_types}}
_typing.AbstractSet
{{/program:generate_abstract_types}}
{{#program:generate_mutable_types}}
_fbthrift_python_mutable_containers.MutableSet
{{/program:generate_mutable_types}}
{{#program:generate_immutable_types}}
_typing.AbstractSet
{{/program:generate_immutable_types}}
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@
}}{{!
This is the base class for Thrift struct
}}{{#program:generate_mutable_types}}{{!
}}_fbthrift_python_mutable_types.MutableStruct{{!
}}{{/program:generate_mutable_types}}{{!
}}{{#program:generate_immutable_types}}{{!
}}_fbthrift_python_types.Struct{{!
}}{{/program:generate_immutable_types}}
}}
{{#pragma single-line}}
{{#program:generate_mutable_types}}
_fbthrift_python_mutable_types.MutableStruct
{{/program:generate_mutable_types}}
{{#program:generate_immutable_types}}
_fbthrift_python_types.Struct
{{/program:generate_immutable_types}}
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@
}}{{!
This is the metaclass for Thrift struct
}}{{#program:generate_mutable_types}}{{!
}}_fbthrift_python_mutable_types.MutableStructMeta{{!
}}{{/program:generate_mutable_types}}{{!
}}{{#program:generate_immutable_types}}{{!
}}_fbthrift_python_types.StructMeta{{!
}}{{/program:generate_immutable_types}}
}}
{{#pragma single-line}}
{{#program:generate_mutable_types}}
_fbthrift_python_mutable_types.MutableStructMeta
{{/program:generate_mutable_types}}
{{#program:generate_immutable_types}}
_fbthrift_python_types.StructMeta
{{/program:generate_immutable_types}}
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@
}}{{!
to pick the Thrift container wrapper type for mutable types
}}{{^field:has_adapter?}}{{!
}}{{#field:type}}{{!
}}{{#type:list?}} | _fbthrift_python_mutable_types._ThriftListWrapper{{/type:list?}}{{!
}}{{#type:set?}} | _fbthrift_python_mutable_types._ThriftSetWrapper{{/type:set?}}{{!
}}{{#type:map?}} | _fbthrift_python_mutable_types._ThriftMapWrapper{{/type:map?}}{{!
}}{{/field:type}}{{!
}}{{/field:has_adapter?}}
}}
{{#pragma single-line}}
{{^field:has_adapter?}}
{{#field:type}}
{{#type:list?}} | _fbthrift_python_mutable_types._ThriftListWrapper{{/type:list?}}
{{#type:set?}} | _fbthrift_python_mutable_types._ThriftSetWrapper{{/type:set?}}
{{#type:map?}} | _fbthrift_python_mutable_types._ThriftMapWrapper{{/type:map?}}
{{/field:type}}
{{/field:has_adapter?}}
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@
}}{{!
This is the base class for Thrift union
}}{{#program:generate_mutable_types}}{{!
}}_fbthrift_python_mutable_types.MutableUnion{{!
}}{{/program:generate_mutable_types}}{{!
}}{{#program:generate_immutable_types}}{{!
}}_fbthrift_python_types.Union{{!
}}{{/program:generate_immutable_types}}
}}
{{#pragma single-line}}
{{#program:generate_mutable_types}}
_fbthrift_python_mutable_types.MutableUnion
{{/program:generate_mutable_types}}
{{#program:generate_immutable_types}}
_fbthrift_python_types.Union
{{/program:generate_immutable_types}}
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@
}}{{!
This is the metaclass for Thrift union
}}{{#program:generate_mutable_types}}{{!
}}_fbthrift_python_mutable_types.MutableUnionMeta{{!
}}{{/program:generate_mutable_types}}{{!
}}{{#program:generate_immutable_types}}{{!
}}_fbthrift_python_types.UnionMeta{{!
}}{{/program:generate_immutable_types}}
}}
{{#pragma single-line}}
{{#program:generate_mutable_types}}
_fbthrift_python_mutable_types.MutableUnionMeta
{{/program:generate_mutable_types}}
{{#program:generate_immutable_types}}
_fbthrift_python_types.UnionMeta
{{/program:generate_immutable_types}}

0 comments on commit ab8506c

Please sign in to comment.