From af0e5f65bb804205bacfd1ee44025dec7e31a76c Mon Sep 17 00:00:00 2001 From: Siddharth VP Date: Sat, 18 May 2024 11:39:24 +0530 Subject: [PATCH] lint: standardize use of spaces in imports --- bot-monitor/Alert.ts | 2 +- bot-monitor/Tabulator.ts | 2 +- bot-monitor/eventstream-trigger.ts | 4 ++-- check-webservice.ts | 2 +- db-tabulator/app.ts | 10 +++++----- db-tabulator/main.ts | 6 +++--- db-tabulator/test.ts | 4 ++-- db.ts | 8 ++++---- dyk-counts/eventstream-trigger.ts | 8 ++++---- dyk-counts/web-endpoint.ts | 4 ++-- eventstream-router/app.ts | 8 ++++---- eventstream-router/main.ts | 4 ++-- eventstream-router/test.ts | 2 +- most-gans/eventstream-updater.ts | 6 +++--- most-gans/gans-lister.ts | 8 ++++---- most-gans/generate-initial.ts | 10 +++++----- most-gans/model.ts | 8 ++++---- most-gans/web-endpoint.ts | 6 +++--- redis.test.ts | 4 ++-- reports/OresUtils.js | 2 +- reports/g13-1week.ts | 8 ++++---- reports/pending-afc.ts | 8 ++++---- utils.ts | 8 ++++---- webservice/app.ts | 4 ++-- webservice/routes/articlesearch.ts | 6 +++--- webservice/routes/logs.ts | 6 +++--- 26 files changed, 74 insertions(+), 74 deletions(-) diff --git a/bot-monitor/Alert.ts b/bot-monitor/Alert.ts index ffd1a43..0dc5440 100644 --- a/bot-monitor/Alert.ts +++ b/bot-monitor/Alert.ts @@ -1,4 +1,4 @@ -import { argv, bot, log, mailTransporter, Mwn } from "../botbase"; +import {argv, bot, log, mailTransporter, Mwn} from "../botbase"; import {Rule, RuleError, Monitor, subtractFromNow, alertsDb} from "./index"; import * as crypto from "crypto"; diff --git a/bot-monitor/Tabulator.ts b/bot-monitor/Tabulator.ts index 137468e..e123f6b 100644 --- a/bot-monitor/Tabulator.ts +++ b/bot-monitor/Tabulator.ts @@ -1,4 +1,4 @@ -import { bot, Mwn, log, argv, enwikidb } from "../botbase"; +import {bot, Mwn, log, argv, enwikidb} from "../botbase"; import {Monitor} from './index'; import * as moment from "moment"; diff --git a/bot-monitor/eventstream-trigger.ts b/bot-monitor/eventstream-trigger.ts index 5bb991a..88791f4 100644 --- a/bot-monitor/eventstream-trigger.ts +++ b/bot-monitor/eventstream-trigger.ts @@ -1,5 +1,5 @@ -import { Route } from "../eventstream-router/app"; -import { invokeCronJob } from "../k8s"; +import {Route} from "../eventstream-router/app"; +import {invokeCronJob} from "../k8s"; export default class BotActivityMonitor extends Route { name = "bot-activity-monitor"; diff --git a/check-webservice.ts b/check-webservice.ts index 7b57e68..b1d3d86 100644 --- a/check-webservice.ts +++ b/check-webservice.ts @@ -1,4 +1,4 @@ -import { emailOnError, Mwn } from './botbase'; +import {emailOnError, Mwn} from './botbase'; process.chdir(__dirname + '/webservice'); diff --git a/db-tabulator/app.ts b/db-tabulator/app.ts index 393c6cc..f67ab55 100644 --- a/db-tabulator/app.ts +++ b/db-tabulator/app.ts @@ -1,9 +1,9 @@ -import { argv, bot, emailOnError, log, Mwn, TextExtractor } from "../botbase"; -import { enwikidb, SQLError } from "../db"; -import { Template } from "../../mwn/build/wikitext"; -import { arrayChunk, createLogStream, lowerFirst, readFile, stripOuterNowikis, writeFile } from "../utils"; +import {argv, bot, emailOnError, log, Mwn, TextExtractor} from "../botbase"; +import {enwikidb, SQLError} from "../db"; +import {Template} from "../../mwn/build/wikitext"; +import {arrayChunk, createLogStream, lowerFirst, readFile, stripOuterNowikis, writeFile} from "../utils"; import {NS_CATEGORY, NS_FILE, NS_MAIN} from "../namespaces"; -import { formatSummary } from "../reports/commons"; +import {formatSummary} from "../reports/commons"; import {MetadataStore} from "./MetadataStore"; import {HybridMetadataStore} from "./HybridMetadataStore"; import {applyJsPreprocessing, processQueriesExternally} from "./preprocess"; diff --git a/db-tabulator/main.ts b/db-tabulator/main.ts index df3deb2..3120a60 100644 --- a/db-tabulator/main.ts +++ b/db-tabulator/main.ts @@ -1,6 +1,6 @@ -import { argv, bot, emailOnError, log } from "../botbase"; -import { writeFile } from "../utils"; -import { checkShutoff, FAKE_OUTPUT_FILE, fetchQueries, processQueries, metadataStore } from "./app"; +import {argv, bot, emailOnError, log} from "../botbase"; +import {writeFile} from "../utils"; +import {checkShutoff, FAKE_OUTPUT_FILE, fetchQueries, processQueries, metadataStore} from "./app"; /** * Specs: diff --git a/db-tabulator/test.ts b/db-tabulator/test.ts index 290dd49..f0faa01 100644 --- a/db-tabulator/test.ts +++ b/db-tabulator/test.ts @@ -1,5 +1,5 @@ -import { Query } from "./app"; -import { bot } from "../botbase"; +import {Query} from "./app"; +import {bot} from "../botbase"; import assert = require("assert"); import {NoMetadataStore} from "./NoMetadataStore"; import {Template} from "../../mwn/build/wikitext"; diff --git a/db.ts b/db.ts index 80c213b..597119e 100644 --- a/db.ts +++ b/db.ts @@ -3,11 +3,11 @@ * Automatically handles transient connection errors. */ -import { AuthManager, bot, log } from './botbase'; +import {AuthManager, bot, log} from './botbase'; import * as mysql from 'mysql2/promise'; -export { mysql }; -import type { MwnDate } from "../mwn"; -import { onToolforge } from "./utils"; +export {mysql}; +import type {MwnDate} from "../mwn"; +import {onToolforge} from "./utils"; export const ENWIKI_DB_HOST = 'enwiki.analytics.db.svc.wikimedia.cloud'; export const TOOLS_DB_HOST = 'tools.db.svc.wikimedia.cloud'; diff --git a/dyk-counts/eventstream-trigger.ts b/dyk-counts/eventstream-trigger.ts index a34d4a3..54bebda 100644 --- a/dyk-counts/eventstream-trigger.ts +++ b/dyk-counts/eventstream-trigger.ts @@ -1,7 +1,7 @@ -import { bot } from "../botbase"; -import { Route } from "../eventstream-router/app"; -import { createLocalSSHTunnel } from "../utils"; -import { ENWIKI_DB_HOST, enwikidb } from "../db"; +import {bot} from "../botbase"; +import {Route} from "../eventstream-router/app"; +import {createLocalSSHTunnel} from "../utils"; +import {ENWIKI_DB_HOST, enwikidb} from "../db"; import {Redis, getRedisInstance} from "../redis"; import {RecentChangeStreamEvent} from "../eventstream-router/RecentChangeStreamEvent"; import {Cache, CacheClass} from "memory-cache"; diff --git a/dyk-counts/web-endpoint.ts b/dyk-counts/web-endpoint.ts index 09b3380..645f7f1 100644 --- a/dyk-counts/web-endpoint.ts +++ b/dyk-counts/web-endpoint.ts @@ -1,7 +1,7 @@ import * as express from "express"; import 'express-async-errors'; -import { enwikidb } from "../db"; -import { getRedisInstance } from "../redis"; +import {enwikidb} from "../db"; +import {getRedisInstance} from "../redis"; const router = express.Router(); const db = new enwikidb(); diff --git a/eventstream-router/app.ts b/eventstream-router/app.ts index 9a7fc03..cd10f3e 100644 --- a/eventstream-router/app.ts +++ b/eventstream-router/app.ts @@ -1,8 +1,8 @@ -import { argv, bot, emailOnError, fs, log } from "../botbase"; -import { RecentChangeStreamEvent } from "./RecentChangeStreamEvent"; -import { createLogStream, stringifyObject } from "../utils"; +import {argv, bot, emailOnError, fs, log} from "../botbase"; +import {RecentChangeStreamEvent} from "./RecentChangeStreamEvent"; +import {createLogStream, stringifyObject} from "../utils"; import EventSource = require("./EventSource"); -import { MINUTE, SECOND } from "../millis"; +import {MINUTE, SECOND} from "../millis"; // TODO: improve logging diff --git a/eventstream-router/main.ts b/eventstream-router/main.ts index ce2ada3..e7aead2 100644 --- a/eventstream-router/main.ts +++ b/eventstream-router/main.ts @@ -1,5 +1,5 @@ -import { argv, log } from '../botbase'; -import { streamWithRoutes } from "./app"; +import {argv, log} from '../botbase'; +import {streamWithRoutes} from "./app"; log(`[S] Started`); process.chdir(__dirname); diff --git a/eventstream-router/test.ts b/eventstream-router/test.ts index ec9a61e..7751a71 100644 --- a/eventstream-router/test.ts +++ b/eventstream-router/test.ts @@ -1,4 +1,4 @@ -import { Route } from "./app"; +import {Route} from "./app"; export default class Test extends Route { init() { diff --git a/most-gans/eventstream-updater.ts b/most-gans/eventstream-updater.ts index dc60c9d..5dc5608 100644 --- a/most-gans/eventstream-updater.ts +++ b/most-gans/eventstream-updater.ts @@ -1,6 +1,6 @@ -import { bot } from '../botbase'; -import { processArticle, TABLE, db } from "./model"; -import { pageFromCategoryEvent, Route } from "../eventstream-router/app"; +import {bot} from '../botbase'; +import {processArticle, TABLE, db} from "./model"; +import {pageFromCategoryEvent, Route} from "../eventstream-router/app"; import type {ResultSetHeader} from "mysql2"; import {NS_MAIN} from "../namespaces"; diff --git a/most-gans/gans-lister.ts b/most-gans/gans-lister.ts index dc192e2..6664335 100644 --- a/most-gans/gans-lister.ts +++ b/most-gans/gans-lister.ts @@ -1,7 +1,7 @@ -import { argv, bot, log, Mwn } from '../botbase'; -import { TOOLS_DB_HOST, toolsdb } from '../db'; -import { closeTunnels, createLocalSSHTunnel, withIndices } from "../utils"; -import { TABLE } from "./model"; +import {argv, bot, log, Mwn} from '../botbase'; +import {TOOLS_DB_HOST, toolsdb} from '../db'; +import {closeTunnels, createLocalSSHTunnel, withIndices} from "../utils"; +import {TABLE} from "./model"; (async function () { diff --git a/most-gans/generate-initial.ts b/most-gans/generate-initial.ts index 1650481..affe490 100644 --- a/most-gans/generate-initial.ts +++ b/most-gans/generate-initial.ts @@ -1,8 +1,8 @@ -import { argv, bot, log } from '../botbase'; -import { closeTunnels, createLocalSSHTunnel } from "../utils"; -import { TOOLS_DB_HOST } from "../db"; -import { processArticle, db, TABLE, runManualEdits } from "./model"; -import { restartDeployment } from "../k8s"; +import {argv, bot, log} from '../botbase'; +import {closeTunnels, createLocalSSHTunnel} from "../utils"; +import {TOOLS_DB_HOST} from "../db"; +import {processArticle, db, TABLE, runManualEdits} from "./model"; +import {restartDeployment} from "../k8s"; bot.setOptions({ silent: true, diff --git a/most-gans/model.ts b/most-gans/model.ts index ee1590d..36ced16 100644 --- a/most-gans/model.ts +++ b/most-gans/model.ts @@ -1,8 +1,8 @@ -import { bot, log, toolsdb } from "../botbase"; -import { NS_USER, NS_USER_TALK } from "../namespaces"; -import { createLogStream } from "../utils"; +import {bot, log, toolsdb} from "../botbase"; +import {NS_USER, NS_USER_TALK} from "../namespaces"; +import {createLogStream} from "../utils"; import * as fs from "fs"; -import { JSDOM } from 'jsdom'; +import {JSDOM} from 'jsdom'; export const db = new toolsdb('goodarticles_p'); export const TABLE = 'nominators'; diff --git a/most-gans/web-endpoint.ts b/most-gans/web-endpoint.ts index 94f22f8..a3ce765 100644 --- a/most-gans/web-endpoint.ts +++ b/most-gans/web-endpoint.ts @@ -1,8 +1,8 @@ import * as express from "express"; import 'express-async-errors'; -import { toolsdb } from '../db'; -import { AuthManager, bot } from "../botbase"; -import { TABLE } from '../../SDZeroBot/most-gans/model'; +import {toolsdb} from '../db'; +import {AuthManager, bot} from "../botbase"; +import {TABLE} from '../../SDZeroBot/most-gans/model'; const router = express.Router(); diff --git a/redis.test.ts b/redis.test.ts index 1bf3435..7b175f0 100644 --- a/redis.test.ts +++ b/redis.test.ts @@ -1,6 +1,6 @@ -import { getRedisInstance, REDIS_HOST } from "./redis"; +import {getRedisInstance, REDIS_HOST} from "./redis"; import assert = require("assert"); -import { createLocalSSHTunnel } from "./utils"; +import {createLocalSSHTunnel} from "./utils"; it('redis', async function () { this.timeout(10000); diff --git a/reports/OresUtils.js b/reports/OresUtils.js index 726f981..4243d6c 100644 --- a/reports/OresUtils.js +++ b/reports/OresUtils.js @@ -3,7 +3,7 @@ * sortlist tasks. */ -const { bot, utils, log } = require('../botbase'); +const {bot, utils, log} = require('../botbase'); module.exports = { diff --git a/reports/g13-1week.ts b/reports/g13-1week.ts index 5e89035..93291e9 100644 --- a/reports/g13-1week.ts +++ b/reports/g13-1week.ts @@ -1,5 +1,5 @@ -import { argv, bot, emailOnError, log, Mwn, TextExtractor } from "../botbase"; -import { ApiRevision, MwnDate} from "../../mwn"; +import {argv, bot, emailOnError, log, Mwn, TextExtractor} from "../botbase"; +import {MwnDate} from "../../mwn"; import { AfcDraftSize, comparators, @@ -8,8 +8,8 @@ import { preprocessDraftForExtract, saveWithBlacklistHandling } from "./commons"; -import { arrayChunk, createLocalSSHTunnel } from "../utils"; -import { ENWIKI_DB_HOST, enwikidb } from "../db"; +import {arrayChunk, createLocalSSHTunnel} from "../utils"; +import {ENWIKI_DB_HOST, enwikidb} from "../db"; const REPORT_PAGE = 'User:SDZeroBot/G13 soon' + (argv.sandbox ? '/sandbox2' : ''); diff --git a/reports/pending-afc.ts b/reports/pending-afc.ts index 28d4d4a..7b23574 100644 --- a/reports/pending-afc.ts +++ b/reports/pending-afc.ts @@ -1,4 +1,4 @@ -import { argv, bot, emailOnError, enwikidb, log, Mwn, TextExtractor } from "../botbase"; +import {argv, bot, emailOnError, enwikidb, log, Mwn, TextExtractor} from "../botbase"; import { AfcDraftSize, comparators, @@ -6,9 +6,9 @@ import { populateWikidataShortdescs, preprocessDraftForExtract, saveWithBlacklistHandling } from "./commons"; -import { createLocalSSHTunnel, arrayChunk, len } from "../utils"; -import { ENWIKI_DB_HOST } from "../db"; -import { NS_DRAFT } from "../namespaces"; +import {createLocalSSHTunnel, arrayChunk, len} from "../utils"; +import {ENWIKI_DB_HOST} from "../db"; +import {NS_DRAFT} from "../namespaces"; (async function() { diff --git a/utils.ts b/utils.ts index 11b6fca..87cb706 100644 --- a/utils.ts +++ b/utils.ts @@ -1,7 +1,7 @@ -import { bot, fs, log } from "./botbase"; -import { spawn } from "child_process"; -import { ENWIKI_DB_HOST, TOOLS_DB_HOST } from "./db"; -import { REDIS_HOST } from "./redis"; +import {bot, fs, log} from "./botbase"; +import {spawn} from "child_process"; +import {ENWIKI_DB_HOST, TOOLS_DB_HOST} from "./db"; +import {REDIS_HOST} from "./redis"; import {SECOND} from "./millis"; export function readFile(file: string) { diff --git a/webservice/app.ts b/webservice/app.ts index 885aed7..294f31c 100644 --- a/webservice/app.ts +++ b/webservice/app.ts @@ -9,8 +9,8 @@ import * as cors from 'cors'; // All paths to SDZeroBot files must be via ../../SDZeroBot rather than via ../ // The latter will work locally but not when inside toolforge www/js directory! import {bot, logFullError, Mwn} from "../../SDZeroBot/botbase"; -import { humanDate } from "../../mwn/build/log"; -import { registerRoutes } from "./route-registry"; +import {humanDate} from "../../mwn/build/log"; +import {registerRoutes} from "./route-registry"; const app = express(); diff --git a/webservice/routes/articlesearch.ts b/webservice/routes/articlesearch.ts index ec3e02d..37b7bf7 100644 --- a/webservice/routes/articlesearch.ts +++ b/webservice/routes/articlesearch.ts @@ -1,8 +1,8 @@ import * as express from "express"; import 'express-async-errors'; -import { JSDOM } from 'jsdom'; -import { bot, TextExtractor } from '../../../SDZeroBot/botbase'; -import { numericArg } from "../utils"; +import {JSDOM} from 'jsdom'; +import {bot, TextExtractor} from '../../../SDZeroBot/botbase'; +import {numericArg} from "../utils"; const router = express.Router(); diff --git a/webservice/routes/logs.ts b/webservice/routes/logs.ts index 9ad21bc..67752cd 100644 --- a/webservice/routes/logs.ts +++ b/webservice/routes/logs.ts @@ -1,7 +1,7 @@ import * as express from "express"; -import { exec } from "child_process"; -import { mapPath } from "../../../SDZeroBot/utils"; -import { numericArg } from "../utils"; +import {exec} from "child_process"; +import {mapPath} from "../../../SDZeroBot/utils"; +import {numericArg} from "../utils"; const router = express.Router();