From 7288286fd96a1c1847520c8993a74e33a4b1add6 Mon Sep 17 00:00:00 2001 From: "Wei S." <5291640+wayneshn@users.noreply.github.com> Date: Sun, 17 Aug 2025 17:42:49 +0300 Subject: [PATCH] Format checked, contributing.md update (#49) Co-authored-by: Wayne <5291640+ringoinca@users.noreply.github.com> --- CONTRIBUTING.md | 10 ++++++++++ .../src/api/controllers/ingestion.controller.ts | 11 ++++------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index edf78f0..40ecbf1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -51,3 +51,13 @@ This project and everyone participating in it is governed by the [Open Archiver - Follow the existing code style. - Use TypeScript's strict mode. - Avoid using `any` as a type. Define clear interfaces and types in the `packages/types` directory. + +### Formatting + +We use Prettier for code formatting. Before you commit new code, it is necessary to check code format by running this command from the root folder: + +`pnpm run lint` + +If there are any format issues, you can use the following command to fix them + +`pnpm run format` diff --git a/packages/backend/src/api/controllers/ingestion.controller.ts b/packages/backend/src/api/controllers/ingestion.controller.ts index 746f1c8..c9d3ed2 100644 --- a/packages/backend/src/api/controllers/ingestion.controller.ts +++ b/packages/backend/src/api/controllers/ingestion.controller.ts @@ -33,13 +33,10 @@ export class IngestionController { } catch (error: any) { logger.error({ err: error }, 'Create ingestion source error'); // Return a 400 Bad Request for connection errors - return res - .status(400) - .json({ - message: - error.message || - 'Failed to create ingestion source due to a connection error.', - }); + return res.status(400).json({ + message: + error.message || 'Failed to create ingestion source due to a connection error.', + }); } };