From b36705c4f4155d4eb5320b60573aa28d36a4e64a Mon Sep 17 00:00:00 2001 From: Andrew Ferrazzutti Date: Wed, 5 Feb 2025 09:43:21 -0500 Subject: [PATCH] Run lint-staged on all new files --- modules/restricted-guests/synapse/README.md | 12 ++--- .../restricted-guests/synapse/package.json | 38 ++++++++-------- .../synapse/scripts/run_in_venv.js | 44 +++++++++---------- 3 files changed, 47 insertions(+), 47 deletions(-) diff --git a/modules/restricted-guests/synapse/README.md b/modules/restricted-guests/synapse/README.md index 52e14ae710..621a648707 100644 --- a/modules/restricted-guests/synapse/README.md +++ b/modules/restricted-guests/synapse/README.md @@ -28,8 +28,8 @@ Add module configuration into `modules` section of `homeserver.yaml`: ```yaml modules: - - module: synapse_guest_module.GuestModule - config: {} + - module: synapse_guest_module.GuestModule + config: {} ``` ## Module configuration @@ -45,10 +45,10 @@ Example configuration: ```yaml modules: - - module: synapse_guest_module.GuestModule - config: - # Use a german suffix - display_name_suffix: ' (Gast)' + - module: synapse_guest_module.GuestModule + config: + # Use a german suffix + display_name_suffix: " (Gast)" ``` ## Production installation diff --git a/modules/restricted-guests/synapse/package.json b/modules/restricted-guests/synapse/package.json index 468b3f4254..7f1ef45b65 100644 --- a/modules/restricted-guests/synapse/package.json +++ b/modules/restricted-guests/synapse/package.json @@ -1,21 +1,21 @@ { - "name": "@element-hq/synapse-guest-module", - "version": "2.0.0", - "private": true, - "description": "A synapse module to restrict the actions of guests", - "author": "New Vector Ltd.", - "license": "Apache-2.0", - "scripts": { - "clean": "echo \"Nothing to clean\"", - "build": "echo \"Nothing to build\"", - "docker:build": "docker build -t element-hq/synapse-guest-module -f Dockerfile .", - "tsc": "echo \"Nothing to tsc\"", - "lint": "echo \"Nothing to lint\"", - "types:py": "node ./scripts/run_in_venv.js tox -e check_types", - "lint:py": "node ./scripts/run_in_venv.js tox -e check_codestyle", - "lint:fix": "node ./scripts/run_in_venv.js tox -e fix_codestyle", - "test": "node ./scripts/run_in_venv.js tox -e py", - "depcheck": "echo \"Nothing to check\"", - "package": "yarn docker:build" - } + "name": "@element-hq/synapse-guest-module", + "version": "2.0.0", + "private": true, + "description": "A synapse module to restrict the actions of guests", + "author": "New Vector Ltd.", + "license": "Apache-2.0", + "scripts": { + "clean": "echo \"Nothing to clean\"", + "build": "echo \"Nothing to build\"", + "docker:build": "docker build -t element-hq/synapse-guest-module -f Dockerfile .", + "tsc": "echo \"Nothing to tsc\"", + "lint": "echo \"Nothing to lint\"", + "types:py": "node ./scripts/run_in_venv.js tox -e check_types", + "lint:py": "node ./scripts/run_in_venv.js tox -e check_codestyle", + "lint:fix": "node ./scripts/run_in_venv.js tox -e fix_codestyle", + "test": "node ./scripts/run_in_venv.js tox -e py", + "depcheck": "echo \"Nothing to check\"", + "package": "yarn docker:build" + } } diff --git a/modules/restricted-guests/synapse/scripts/run_in_venv.js b/modules/restricted-guests/synapse/scripts/run_in_venv.js index ee392ecbee..472d471c32 100644 --- a/modules/restricted-guests/synapse/scripts/run_in_venv.js +++ b/modules/restricted-guests/synapse/scripts/run_in_venv.js @@ -21,39 +21,39 @@ // // Example: $ node ./run_in_venv.js python --version -const fs = require('fs'); -const path = require('path'); -const child_process = require('child_process'); +const fs = require("fs"); +const path = require("path"); +const child_process = require("child_process"); -const cwd = path.resolve(__dirname, '..'); -const venvPath = path.resolve(__dirname, '../../../.venv'); +const cwd = path.resolve(__dirname, ".."); +const venvPath = path.resolve(__dirname, "../../../.venv"); const venvRelativeToCwd = path.relative(cwd, venvPath); function run(command) { - return new Promise((resolve) => { - const proc = child_process.spawn( - `source ${venvRelativeToCwd}/bin/activate && ${command}`, - [], - { cwd, stdio: 'inherit', shell: true }, - ); + return new Promise((resolve) => { + const proc = child_process.spawn(`source ${venvRelativeToCwd}/bin/activate && ${command}`, [], { + cwd, + stdio: "inherit", + shell: true, + }); - proc.on('close', (code) => { - console.log('command terminated:', code); - resolve(); + proc.on("close", (code) => { + console.log("command terminated:", code); + resolve(); + }); }); - }); } async function main() { - if (!fs.existsSync(venvPath) || !fs.lstatSync(venvPath).isDirectory()) { - child_process.execSync(`python3 -m venv ${venvRelativeToCwd}`, { cwd }); - await run('pip install tox'); - await run('pip install -e ."[dev]"'); - } + if (!fs.existsSync(venvPath) || !fs.lstatSync(venvPath).isDirectory()) { + child_process.execSync(`python3 -m venv ${venvRelativeToCwd}`, { cwd }); + await run("pip install tox"); + await run('pip install -e ."[dev]"'); + } - const command = process.argv.slice(2).join(' '); + const command = process.argv.slice(2).join(" "); - await run(command); + await run(command); } main();