Run lint-staged on all new files

This commit is contained in:
Andrew Ferrazzutti
2025-02-05 09:43:21 -05:00
parent caabc37519
commit b36705c4f4
3 changed files with 47 additions and 47 deletions
+1 -1
View File
@@ -48,7 +48,7 @@ modules:
- module: synapse_guest_module.GuestModule - module: synapse_guest_module.GuestModule
config: config:
# Use a german suffix # Use a german suffix
display_name_suffix: ' (Gast)' display_name_suffix: " (Gast)"
``` ```
## Production installation ## Production installation
@@ -21,24 +21,24 @@
// //
// Example: $ node ./run_in_venv.js python --version // Example: $ node ./run_in_venv.js python --version
const fs = require('fs'); const fs = require("fs");
const path = require('path'); const path = require("path");
const child_process = require('child_process'); const child_process = require("child_process");
const cwd = path.resolve(__dirname, '..'); const cwd = path.resolve(__dirname, "..");
const venvPath = path.resolve(__dirname, '../../../.venv'); const venvPath = path.resolve(__dirname, "../../../.venv");
const venvRelativeToCwd = path.relative(cwd, venvPath); const venvRelativeToCwd = path.relative(cwd, venvPath);
function run(command) { function run(command) {
return new Promise((resolve) => { return new Promise((resolve) => {
const proc = child_process.spawn( const proc = child_process.spawn(`source ${venvRelativeToCwd}/bin/activate && ${command}`, [], {
`source ${venvRelativeToCwd}/bin/activate && ${command}`, cwd,
[], stdio: "inherit",
{ cwd, stdio: 'inherit', shell: true }, shell: true,
); });
proc.on('close', (code) => { proc.on("close", (code) => {
console.log('command terminated:', code); console.log("command terminated:", code);
resolve(); resolve();
}); });
}); });
@@ -47,11 +47,11 @@ function run(command) {
async function main() { async function main() {
if (!fs.existsSync(venvPath) || !fs.lstatSync(venvPath).isDirectory()) { if (!fs.existsSync(venvPath) || !fs.lstatSync(venvPath).isDirectory()) {
child_process.execSync(`python3 -m venv ${venvRelativeToCwd}`, { cwd }); child_process.execSync(`python3 -m venv ${venvRelativeToCwd}`, { cwd });
await run('pip install tox'); await run("pip install tox");
await run('pip install -e ."[dev]"'); 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);
} }