From 06691e1e45dafaa61b77de966ced937b8a73109b Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Wed, 15 Jul 2020 11:45:38 -0700 Subject: [PATCH] prettier: Disable bracketSpacing. Signed-off-by: Anders Kaseorg --- prettier.config.js | 3 ++ zerver/openapi/testing.yaml | 12 ++--- zerver/openapi/zulip.yaml | 105 +++++++++++++++++------------------- 3 files changed, 58 insertions(+), 62 deletions(-) create mode 100644 prettier.config.js diff --git a/prettier.config.js b/prettier.config.js new file mode 100644 index 0000000000..5f9d8da169 --- /dev/null +++ b/prettier.config.js @@ -0,0 +1,3 @@ +module.exports = { + bracketSpacing: false, +}; diff --git a/zerver/openapi/testing.yaml b/zerver/openapi/testing.yaml index 7e5c4233d1..fff7617fc4 100644 --- a/zerver/openapi/testing.yaml +++ b/zerver/openapi/testing.yaml @@ -33,8 +33,8 @@ test1: { "top_array": [ - { "obj": { "str3": "test" } }, - [{ "str1": "success", "str2": "success" }], + {"obj": {"str3": "test"}}, + [{"str1": "success", "str2": "success"}], ], } test2: @@ -73,8 +73,8 @@ test2: { "top_array": [ - { "obj": { "str3": "test", "str4": "extraneous" } }, - [{ "str1": "success", "str2": "success" }], + {"obj": {"str3": "test", "str4": "extraneous"}}, + [{"str1": "success", "str2": "success"}], ], } test3: @@ -109,7 +109,7 @@ test3: { "top_array": [ - { "obj": { "str3": "test" } }, - [{ "str1": "success", "str2": "success" }], + {"obj": {"str3": "test"}}, + [{"str1": "success", "str2": "success"}], ], } diff --git a/zerver/openapi/zulip.yaml b/zerver/openapi/zulip.yaml index b5ea648d0b..c7aca4f27b 100644 --- a/zerver/openapi/zulip.yaml +++ b/zerver/openapi/zulip.yaml @@ -274,7 +274,7 @@ paths: type: integer description: | The ID of the given stream. - - example: { "msg": "", "result": "success", "stream_id": 15 } + - example: {"msg": "", "result": "success", "stream_id": 15} "400": description: Bad request. content: @@ -441,8 +441,8 @@ paths: "create_time": 1588145417000, "messages": [ - { "id": 102, "date_sent": 1588145424000 }, - { "id": 103, "date_sent": 1588145448000 }, + {"id": 102, "date_sent": 1588145424000}, + {"id": 103, "date_sent": 1588145448000}, ], }, ], @@ -540,7 +540,7 @@ paths: items: type: object default: [] - example: [{ "operand": "Denmark", "operator": "stream" }] + example: [{"operand": "Denmark", "operator": "stream"}] - $ref: "#/components/parameters/ClientGravatar" - name: apply_markdown in: query @@ -771,7 +771,7 @@ paths: be sent. Note that scheduled messages ("Send later") is a beta API and may change before it's a finished feature. example: "2020-06-24 11:19:54.337533+00:00" - - example: { "msg": "", "id": 42, "result": "success" } + - example: {"msg": "", "id": 42, "result": "success"} "400": description: Bad request. content: @@ -952,11 +952,7 @@ paths: description: | An array with the IDs of the modified messages. - example: - { - "msg": "", - "messages": [4, 18, 15], - "result": "success", - } + {"msg": "", "messages": [4, 18, 15], "result": "success"} /messages/render: post: operationId: render_message @@ -1092,7 +1088,7 @@ paths: type: array items: type: object - example: [{ "operator": "has", "operand": "link" }] + example: [{"operator": "has", "operand": "link"}] required: true responses: "200": @@ -1438,21 +1434,21 @@ paths: "is_guest": false, "profile_data": { - "4": { "value": "vim" }, + "4": {"value": "vim"}, "2": { "value": "I am:\n* The prince of Denmark\n* Nephew to the usurping Claudius", "rendered_value": "

I am:

\n", }, - "5": { "value": "1900-1-1" }, - "7": { "value": "[11]" }, - "6": { "value": "https://blog.zulig.org" }, + "5": {"value": "1900-1-1"}, + "7": {"value": "[11]"}, + "6": {"value": "https://blog.zulig.org"}, "1": { "value": "+0-11-23-456-7890", "rendered_value": "

+0-11-23-456-7890

", }, - "8": { "value": "zulipbot" }, + "8": {"value": "zulipbot"}, "3": { "rendered_value": "

Dark chocolate

", @@ -1562,7 +1558,7 @@ paths: schema: allOf: - $ref: "#/components/schemas/JsonSuccess" - - example: { "msg": "", "result": "success" } + - example: {"msg": "", "result": "success"} /users/{email}/presence: get: @@ -1636,11 +1632,11 @@ paths: "presence": { "website": - { "timestamp": 1532697622, "status": "active" }, + {"timestamp": 1532697622, "status": "active"}, "ZulipMobile": - { "timestamp": 1522687421, "status": "active" }, + {"timestamp": 1522687421, "status": "active"}, "aggregated": - { "timestamp": 1532697622, "status": "active" }, + {"timestamp": 1532697622, "status": "active"}, }, "result": "success", "msg": "", @@ -1781,9 +1777,9 @@ paths: "user_id": 5, "profile_data": { - "5": { "value": "2000-1-1" }, - "4": { "value": "emacs" }, - "7": { "value": "[10]" }, + "5": {"value": "2000-1-1"}, + "4": {"value": "emacs"}, + "7": {"value": "[10]"}, "1": { "value": "+1-234-567-8901", @@ -1794,7 +1790,7 @@ paths: "rendered_value": "

Betrayer of Othello.

", "value": "Betrayer of Othello.", }, - "8": { "value": "zulip" }, + "8": {"value": "zulip"}, "3": { "value": "Apples", @@ -1819,7 +1815,7 @@ paths: schema: allOf: - $ref: "#/components/schemas/JsonSuccess" - - example: { "msg": "", "result": "success" } + - example: {"msg": "", "result": "success"} "400": description: Bad Request content: @@ -1873,9 +1869,9 @@ paths: "result": "success", "topics": [ - { "max_id": 26, "name": "Denmark3" }, - { "max_id": 23, "name": "Denmark1" }, - { "max_id": 6, "name": "Denmark2" }, + {"max_id": 26, "name": "Denmark3"}, + {"max_id": 23, "name": "Denmark1"}, + {"max_id": 6, "name": "Denmark2"}, ], } "400": @@ -2177,7 +2173,7 @@ paths: type: array items: type: object - example: [{ "name": "Verona", "description": "Italian City" }] + example: [{"name": "Verona", "description": "Italian City"}] required: true - $ref: "#/components/parameters/Principals" - name: authorization_errors_fatal @@ -2234,14 +2230,14 @@ paths: "already_subscribed": {}, "msg": "", "result": "success", - "subscribed": { "iago@zulip.com": ["new stream"] }, + "subscribed": {"iago@zulip.com": ["new stream"]}, } - allOf: - $ref: "#/components/schemas/AddSubscriptionsResponse" - example: { "already_subscribed": - { "newbie@zulip.com": ["new stream"] }, + {"newbie@zulip.com": ["new stream"]}, "msg": "", "result": "success", "subscribed": {}, @@ -2309,7 +2305,7 @@ paths: type: string example: [ - { "name": "Verona" }, + {"name": "Verona"}, { "name": "Denmark", "color": "#e79ab5", @@ -2377,7 +2373,7 @@ paths: { "msg": "", "subscribed": {}, - "already_subscribed": { "iago@zulip.com": ["Verona"] }, + "already_subscribed": {"iago@zulip.com": ["Verona"]}, "not_removed": [], "removed": ["new stream"], "result": "success", @@ -2469,7 +2465,7 @@ paths: description: | Whether the user is subscribed to the stream. - example: - { "msg": "", "result": "success", "is_subscribed": false } + {"msg": "", "result": "success", "is_subscribed": false} /users/me/subscriptions/muted_topics: patch: operationId: mute_topic @@ -2522,11 +2518,11 @@ paths: - allOf: - $ref: "#/components/schemas/JsonError" - example: - { "msg": "Topic already muted", "result": "error" } + {"msg": "Topic already muted", "result": "error"} - allOf: - $ref: "#/components/schemas/JsonError" - example: - { "msg": "Topic is not muted", "result": "error" } + {"msg": "Topic is not muted", "result": "error"} /realm/emoji/{emoji_name}: post: operationId: upload_custom_emoji @@ -2661,8 +2657,8 @@ paths: type: object example: [ - { "stream_id": 1, "property": "pin_to_top", "value": true }, - { "stream_id": 3, "property": "color", "value": "#f00f00" }, + {"stream_id": 1, "property": "pin_to_top", "value": true}, + {"stream_id": 3, "property": "color", "value": "#f00f00"}, ] required: true responses: @@ -2795,21 +2791,21 @@ paths: "is_guest": false, "profile_data": { - "4": { "value": "vim" }, + "4": {"value": "vim"}, "2": { "value": "I am:\n* The prince of Denmark\n* Nephew to the usurping Claudius", "rendered_value": "

I am:

\n", }, - "5": { "value": "1900-1-1" }, - "7": { "value": "[11]" }, - "6": { "value": "https://blog.zulig.org" }, + "5": {"value": "1900-1-1"}, + "7": {"value": "[11]"}, + "6": {"value": "https://blog.zulig.org"}, "1": { "value": "+0-11-23-456-7890", "rendered_value": "

+0-11-23-456-7890

", }, - "8": { "value": "zulipbot" }, + "8": {"value": "zulipbot"}, "3": { "rendered_value": "

Dark chocolate

", @@ -2884,10 +2880,7 @@ paths: items: type: object example: - [ - { "id": 4, "value": "vim" }, - { "id": 5, "value": "1909-04-05" }, - ] + [{"id": 4, "value": "vim"}, {"id": 5, "value": "1909-04-05"}] required: false responses: @@ -2929,7 +2922,7 @@ paths: schema: allOf: - $ref: "#/components/schemas/JsonSuccess" - - example: { "msg": "", "result": "success" } + - example: {"msg": "", "result": "success"} "400": description: Bad Request content: @@ -3034,7 +3027,7 @@ paths: type: integer description: | The numeric ID assigned to this filter. - - example: { "id": 42, "result": "success", "msg": "" } + - example: {"id": 42, "result": "success", "msg": ""} /realm/filters/{filter_id}: delete: operationId: remove_linkifier @@ -3139,7 +3132,7 @@ paths: application/json: schema: type: object - example: { "notification_settings_null": true } + example: {"notification_settings_null": true} - name: fetch_event_types in: query description: | @@ -3887,7 +3880,7 @@ paths: schema: allOf: - $ref: "#/components/schemas/JsonSuccess" - - example: { "msg": "", "result": "success" } + - example: {"msg": "", "result": "success"} "400": description: Bad request. content: @@ -3971,7 +3964,7 @@ paths: schema: allOf: - $ref: "#/components/schemas/JsonSuccess" - - example: { "msg": "", "result": "success" } + - example: {"msg": "", "result": "success"} "400": description: Bad request. content: @@ -4081,7 +4074,7 @@ paths: schema: allOf: - $ref: "#/components/schemas/JsonSuccess" - - example: { "msg": "", "result": "success" } + - example: {"msg": "", "result": "success"} "400": description: Bad request. content: @@ -4155,7 +4148,7 @@ paths: schema: allOf: - $ref: "#/components/schemas/JsonSuccess" - - example: { "result": "success", "msg": "" } + - example: {"result": "success", "msg": ""} "400": description: Bad request. @@ -4752,7 +4745,7 @@ components: - success msg: type: string - - example: { "msg": "", "result": "success" } + - example: {"msg": "", "result": "success"} JsonError: allOf: - $ref: "#/components/schemas/JsonResponse" @@ -4879,7 +4872,7 @@ components: InvalidApiKeyError: allOf: - $ref: "#/components/schemas/JsonError" - - example: { "msg": "Invalid API key", "result": "error" } + - example: {"msg": "Invalid API key", "result": "error"} MissingArgumentError: allOf: - $ref: "#/components/schemas/CodedError"