apply clang format to proto files (#4123)

* add proto files to clangify

* apply clangify to proto files

* remove blocksonsingleline, it didn't actually do anything

also add missing space to the travis warning, emoji are monospace too
This commit is contained in:
ebbit1q 2020-10-02 18:14:05 +02:00 committed by GitHub
parent e2251fe06b
commit 35fe6f624c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
50 changed files with 59 additions and 90 deletions

View file

@ -18,7 +18,7 @@ case $err in
*** Then commit and push those changes to this branch. *** *** Then commit and push those changes to this branch. ***
*** Check our CONTRIBUTING.md file for more details. *** *** Check our CONTRIBUTING.md file for more details. ***
*** *** *** ***
*** Thank you ❤️ *** *** Thank you ❤️ ***
*** *** *** ***
*********************************************************** ***********************************************************

View file

@ -25,3 +25,7 @@ IndentCaseLabels: true
PointerAlignment: Right PointerAlignment: Right
SortIncludes: true SortIncludes: true
IncludeBlocks: Regroup IncludeBlocks: Regroup
---
Language: Proto
AllowShortFunctionsOnASingleLine: None
SpacesInContainerLiterals: false

View file

@ -18,7 +18,7 @@ exclude=("servatrice/src/smtp" \
"oracle/src/zip" \ "oracle/src/zip" \
"oracle/src/lzma" \ "oracle/src/lzma" \
"oracle/src/qt-json") "oracle/src/qt-json")
exts=("cpp" "h") exts=("cpp" "h" "proto")
cf_cmd="clang-format" cf_cmd="clang-format"
branch="origin/master" branch="origin/master"

View file

@ -37,4 +37,3 @@ message Command_AdjustMod {
optional bool should_be_mod = 2; optional bool should_be_mod = 2;
optional bool should_be_judge = 3; optional bool should_be_judge = 3;
} }

View file

@ -10,5 +10,3 @@ message Command_AttachCard {
optional string target_zone = 4; optional string target_zone = 4;
optional sint32 target_card_id = 5 [default = -1]; optional sint32 target_card_id = 5 [default = -1];
} }

View file

@ -6,7 +6,6 @@ message Command_Concede {
} }
} }
message Command_Unconcede { message Command_Unconcede {
extend GameCommand { extend GameCommand {
optional Command_Unconcede ext = 1032; optional Command_Unconcede ext = 1032;

View file

@ -15,5 +15,3 @@ message Command_CreateToken {
optional string target_zone = 9; optional string target_zone = 9;
optional sint32 target_card_id = 10 [default = -1]; optional sint32 target_card_id = 10 [default = -1];
} }

View file

@ -7,4 +7,3 @@ message Command_DeckDelDir {
} }
optional string path = 1; optional string path = 1;
} }

View file

@ -7,4 +7,3 @@ message Command_DeckDownload {
} }
optional sint32 deck_id = 1 [default = -1]; optional sint32 deck_id = 1 [default = -1];
} }

View file

@ -8,4 +8,3 @@ message Command_DeckNewDir {
optional string path = 1; optional string path = 1;
optional string dir_name = 2; optional string dir_name = 2;
} }

View file

@ -5,7 +5,7 @@ message Command_DeckUpload {
extend SessionCommand { extend SessionCommand {
optional Command_DeckUpload ext = 1013; optional Command_DeckUpload ext = 1013;
} }
optional string path = 1; // to upload a new deck optional string path = 1; // to upload a new deck
optional uint32 deck_id = 2; // to replace an existing deck optional uint32 deck_id = 2; // to replace an existing deck
optional string deck_list = 3; optional string deck_list = 3;
} }

View file

@ -6,4 +6,3 @@ message Command_DrawCards {
} }
optional uint32 number = 1; optional uint32 number = 1;
} }

View file

@ -9,5 +9,3 @@ message Command_FlipCard {
optional bool face_down = 3; optional bool face_down = 3;
optional string pt = 4; optional string pt = 4;
} }

View file

@ -6,5 +6,3 @@ message Command_GameSay {
} }
optional string message = 1; optional string message = 1;
} }

View file

@ -3,7 +3,6 @@ import "game_commands.proto";
message Command_KickFromGame { message Command_KickFromGame {
extend GameCommand { extend GameCommand {
optional Command_KickFromGame ext = 1000; optional Command_KickFromGame ext = 1000;
} }
optional sint32 player_id = 1 [default = -1]; optional sint32 player_id = 1 [default = -1];
} }

View file

@ -5,4 +5,3 @@ message Command_LeaveGame {
optional Command_LeaveGame ext = 1001; optional Command_LeaveGame ext = 1001;
} }
} }

View file

@ -23,4 +23,3 @@ message Command_MoveCard {
optional sint32 x = 6 [default = -1]; optional sint32 x = 6 [default = -1];
optional sint32 y = 7 [default = -1]; optional sint32 y = 7 [default = -1];
} }

View file

@ -6,4 +6,3 @@ message Command_Mulligan {
} }
optional uint32 number = 7; optional uint32 number = 7;
} }

View file

@ -8,4 +8,3 @@ message Command_ReplayModifyMatch {
optional sint32 game_id = 1 [default = -1]; optional sint32 game_id = 1 [default = -1];
optional bool do_not_hide = 2; optional bool do_not_hide = 2;
} }

View file

@ -3,6 +3,5 @@ import "game_commands.proto";
message Command_ReverseTurn { message Command_ReverseTurn {
extend GameCommand { extend GameCommand {
optional Command_ReverseTurn ext = 1034; optional Command_ReverseTurn ext = 1034;
} }
} }

View file

@ -6,4 +6,3 @@ message Command_RollDie {
} }
optional uint32 sides = 1; optional uint32 sides = 1;
} }

View file

@ -8,4 +8,3 @@ message Command_SetSideboardPlan {
} }
repeated MoveCard_ToZone move_list = 1; repeated MoveCard_ToZone move_list = 1;
} }

View file

@ -8,4 +8,3 @@ message Command_Shuffle {
optional sint32 start = 2 [default = 0]; optional sint32 start = 2 [default = 0];
optional sint32 end = 3 [default = -1]; optional sint32 end = 3 [default = -1];
} }

View file

@ -6,4 +6,3 @@ message Event_GameHostChanged {
optional Event_GameHostChanged ext = 1003; optional Event_GameHostChanged ext = 1003;
} }
} }

View file

@ -6,4 +6,3 @@ message Event_Kicked {
optional Event_Kicked ext = 1004; optional Event_Kicked ext = 1004;
} }
} }

View file

@ -7,6 +7,3 @@ message Event_LeaveRoom {
} }
optional string name = 1; optional string name = 1;
} }

View file

@ -4,7 +4,7 @@ import "session_event.proto";
message Event_NotifyUser { message Event_NotifyUser {
enum NotificationType { enum NotificationType {
UNKNOWN = 0; // Default enum value if no "type" is defined when used UNKNOWN = 0; // Default enum value if no "type" is defined when used
PROMOTED = 1; PROMOTED = 1;
WARNING = 2; WARNING = 2;
IDLEWARNING = 3; IDLEWARNING = 3;
@ -18,5 +18,4 @@ message Event_NotifyUser {
optional string warning_reason = 2; optional string warning_reason = 2;
optional string custom_title = 3; optional string custom_title = 3;
optional string custom_content = 4; optional string custom_content = 4;
} }

View file

@ -14,5 +14,4 @@ message Event_RoomSay {
optional string message = 2; optional string message = 2;
optional RoomMessageType message_type = 3; optional RoomMessageType message_type = 3;
optional uint64 time_of = 4; optional uint64 time_of = 4;
} }

View file

@ -60,13 +60,12 @@ message Command_ViewLogHistory {
extend ModeratorCommand { extend ModeratorCommand {
optional Command_ViewLogHistory ext = 1005; optional Command_ViewLogHistory ext = 1005;
} }
optional string user_name = 1; // user that created message optional string user_name = 1; // user that created message
optional string ip_address = 2; // ip address of user that created message optional string ip_address = 2; // ip address of user that created message
optional string game_name = 3; // client id of user that created the message optional string game_name = 3; // client id of user that created the message
optional string game_id = 4; // game number the message was sent to optional string game_id = 4; // game number the message was sent to
optional string message = 5; // raw message that was sent optional string message = 5; // raw message that was sent
repeated string log_location = 6; // destination of message (ex: main room, game room, private chat) repeated string log_location = 6; // destination of message (ex: main room, game room, private chat)
required uint32 date_range = 7; // the length of time (in minutes) to look back for required uint32 date_range = 7; // the length of time (in minutes) to look back for
optional uint32 maximum_results = 8; // the maximum number of query results optional uint32 maximum_results = 8; // the maximum number of query results
} }

View file

@ -25,21 +25,23 @@ message Response {
RespAccessDenied = 20; RespAccessDenied = 20;
RespUsernameInvalid = 21; RespUsernameInvalid = 21;
RespRegistrationRequired = 22; RespRegistrationRequired = 22;
RespRegistrationAccepted = 23; // Server agrees to process client's registration request RespRegistrationAccepted = 23; // Server agrees to process client's registration request
RespUserAlreadyExists = 24; // Client attempted to register a name which is already registered RespUserAlreadyExists = 24; // Client attempted to register a name which is already registered
RespEmailRequiredToRegister = 25; // Server requires email to register accounts but client did not provide one RespEmailRequiredToRegister = 25; // Server requires email to register accounts but client did not provide one
RespTooManyRequests = 26; // Server refused to complete command because client has sent too many too quickly RespTooManyRequests = 26; // Server refused to complete command because client has sent too many too quickly
RespPasswordTooShort = 27; // Server requires a decent password RespPasswordTooShort = 27; // Server requires a decent password
RespAccountNotActivated = 28; // Client attempted to log into a registered username but the account hasn't been activated RespAccountNotActivated =
28; // Client attempted to log into a registered username but the account hasn't been activated
RespRegistrationDisabled = 29; // Server does not allow clients to register RespRegistrationDisabled = 29; // Server does not allow clients to register
RespRegistrationFailed = 30; // Server accepted a reg request but failed to perform the registration RespRegistrationFailed = 30; // Server accepted a reg request but failed to perform the registration
RespActivationAccepted = 31; // Server accepted a reg user activation token RespActivationAccepted = 31; // Server accepted a reg user activation token
RespActivationFailed = 32; // Server didn't accept a reg user activation token RespActivationFailed = 32; // Server didn't accept a reg user activation token
RespRegistrationAcceptedNeedsActivation = 33; // Server accepted cient registration, but it will need token activation RespRegistrationAcceptedNeedsActivation =
33; // Server accepted cient registration, but it will need token activation
RespClientIdRequired = 34; // Server requires client to generate and send its client id before allowing access RespClientIdRequired = 34; // Server requires client to generate and send its client id before allowing access
RespClientUpdateRequired = 35; // Client is missing features that the server is requiring RespClientUpdateRequired = 35; // Client is missing features that the server is requiring
RespServerFull = 36; // Server user limit reached RespServerFull = 36; // Server user limit reached
RespEmailBlackListed = 37; // Server has blacklisted the email address provided for registration RespEmailBlackListed = 37; // Server has blacklisted the email address provided for registration
} }
enum ResponseType { enum ResponseType {
JOIN_ROOM = 1000; JOIN_ROOM = 1000;

View file

@ -1,7 +1,7 @@
syntax = "proto2"; syntax = "proto2";
import "response.proto"; import "response.proto";
message Response_AdjustMod{ message Response_AdjustMod {
extend Response { extend Response {
optional Response_AdjustMod ext = 1011; optional Response_AdjustMod ext = 1011;
} }

View file

@ -2,7 +2,7 @@ syntax = "proto2";
import "response.proto"; import "response.proto";
import "serverinfo_ban.proto"; import "serverinfo_ban.proto";
message Response_BanHistory{ message Response_BanHistory {
extend Response { extend Response {
optional Response_BanHistory ext = 1012; optional Response_BanHistory ext = 1012;
} }

View file

@ -10,4 +10,3 @@ message Response_GetGamesOfUser {
repeated ServerInfo_Room room_list = 1; repeated ServerInfo_Room room_list = 1;
repeated ServerInfo_Game game_list = 2; repeated ServerInfo_Game game_list = 2;
} }

View file

@ -8,5 +8,3 @@ message Response_GetUserInfo {
} }
optional ServerInfo_User user_info = 1; optional ServerInfo_User user_info = 1;
} }

View file

@ -8,4 +8,3 @@ message Response_ListUsers {
} }
repeated ServerInfo_User user_list = 1; repeated ServerInfo_User user_list = 1;
} }

View file

@ -7,4 +7,3 @@ message Response_ReplayDownload {
} }
optional bytes replay_data = 1; optional bytes replay_data = 1;
} }

View file

@ -2,7 +2,7 @@ syntax = "proto2";
import "response.proto"; import "response.proto";
import "serverinfo_chat_message.proto"; import "serverinfo_chat_message.proto";
message Response_ViewLogHistory{ message Response_ViewLogHistory {
extend Response { extend Response {
optional Response_ViewLogHistory ext = 1015; optional Response_ViewLogHistory ext = 1015;
} }

View file

@ -2,7 +2,7 @@ syntax = "proto2";
import "response.proto"; import "response.proto";
import "serverinfo_warning.proto"; import "serverinfo_warning.proto";
message Response_WarnHistory{ message Response_WarnHistory {
extend Response { extend Response {
optional Response_WarnHistory ext = 1013; optional Response_WarnHistory ext = 1013;
} }

View file

@ -1,7 +1,7 @@
syntax = "proto2"; syntax = "proto2";
import "response.proto"; import "response.proto";
message Response_WarnList{ message Response_WarnList {
extend Response { extend Response {
optional Response_WarnList ext = 1014; optional Response_WarnList ext = 1014;
} }

View file

@ -3,10 +3,10 @@ syntax = "proto2";
* Historical ban information stored in the ban table * Historical ban information stored in the ban table
*/ */
message ServerInfo_Ban { message ServerInfo_Ban {
required string admin_id = 1; // id of the staff member placing the ban required string admin_id = 1; // id of the staff member placing the ban
required string admin_name = 2; // name of the staff member placing the ban required string admin_name = 2; // name of the staff member placing the ban
required string ban_time = 3; // start time of the ban required string ban_time = 3; // start time of the ban
required string ban_length = 4; // amount of time in minutes the ban is for required string ban_length = 4; // amount of time in minutes the ban is for
optional string ban_reason = 5; // reason seen only by moderation staff optional string ban_reason = 5; // reason seen only by moderation staff
optional string visible_reason = 6; // reason shown to the user optional string visible_reason = 6; // reason shown to the user
} }

View file

@ -5,12 +5,12 @@ syntax = "proto2";
* These communications are also stored in the DB log table. * These communications are also stored in the DB log table.
*/ */
message ServerInfo_ChatMessage { message ServerInfo_ChatMessage {
optional string time = 1; // time chat was sent optional string time = 1; // time chat was sent
optional string sender_id = 2; // id of sender optional string sender_id = 2; // id of sender
optional string sender_name = 3; // name of sender optional string sender_name = 3; // name of sender
optional string sender_ip = 4; // ip of sender optional string sender_ip = 4; // ip of sender
optional string message = 5; // message optional string message = 5; // message
optional string target_type = 6; // target type (room,game,chat) optional string target_type = 6; // target type (room,game,chat)
optional string target_id = 7; // id of target optional string target_id = 7; // id of target
optional string target_name = 8; // name of target optional string target_name = 8; // name of target
} }

View file

@ -3,4 +3,3 @@ message ServerInfo_GameType {
optional sint32 game_type_id = 1; optional sint32 game_type_id = 1;
optional string description = 2; optional string description = 2;
}; };

View file

@ -3,8 +3,8 @@ syntax = "proto2";
* Historical warning information stored in the warnings table * Historical warning information stored in the warnings table
*/ */
message ServerInfo_Warning { message ServerInfo_Warning {
optional string user_name = 1; // name of user being warned optional string user_name = 1; // name of user being warned
optional string admin_name = 2; // name of the moderator making the warning optional string admin_name = 2; // name of the moderator making the warning
optional string reason = 3; // type of warning being placed optional string reason = 3; // type of warning being placed
optional string time_of = 4; // time of warning optional string time_of = 4; // time of warning
} }