Skip to content

Commit

Permalink
lint: standardize use of spaces in imports
Browse files Browse the repository at this point in the history
  • Loading branch information
siddharthvp committed May 18, 2024
1 parent 7cfb591 commit af0e5f6
Show file tree
Hide file tree
Showing 26 changed files with 74 additions and 74 deletions.
2 changes: 1 addition & 1 deletion bot-monitor/Alert.ts
Original file line number Diff line number Diff line change
@@ -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";

Expand Down
2 changes: 1 addition & 1 deletion bot-monitor/Tabulator.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
4 changes: 2 additions & 2 deletions bot-monitor/eventstream-trigger.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
2 changes: 1 addition & 1 deletion check-webservice.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { emailOnError, Mwn } from './botbase';
import {emailOnError, Mwn} from './botbase';

process.chdir(__dirname + '/webservice');

Expand Down
10 changes: 5 additions & 5 deletions db-tabulator/app.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
6 changes: 3 additions & 3 deletions db-tabulator/main.ts
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
4 changes: 2 additions & 2 deletions db-tabulator/test.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
8 changes: 4 additions & 4 deletions db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
8 changes: 4 additions & 4 deletions dyk-counts/eventstream-trigger.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
4 changes: 2 additions & 2 deletions dyk-counts/web-endpoint.ts
Original file line number Diff line number Diff line change
@@ -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();
Expand Down
8 changes: 4 additions & 4 deletions eventstream-router/app.ts
Original file line number Diff line number Diff line change
@@ -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

Expand Down
4 changes: 2 additions & 2 deletions eventstream-router/main.ts
Original file line number Diff line number Diff line change
@@ -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);
Expand Down
2 changes: 1 addition & 1 deletion eventstream-router/test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Route } from "./app";
import {Route} from "./app";

export default class Test extends Route {
init() {
Expand Down
6 changes: 3 additions & 3 deletions most-gans/eventstream-updater.ts
Original file line number Diff line number Diff line change
@@ -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";

Expand Down
8 changes: 4 additions & 4 deletions most-gans/gans-lister.ts
Original file line number Diff line number Diff line change
@@ -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 () {

Expand Down
10 changes: 5 additions & 5 deletions most-gans/generate-initial.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
8 changes: 4 additions & 4 deletions most-gans/model.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
6 changes: 3 additions & 3 deletions most-gans/web-endpoint.ts
Original file line number Diff line number Diff line change
@@ -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();

Expand Down
4 changes: 2 additions & 2 deletions redis.test.ts
Original file line number Diff line number Diff line change
@@ -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);
Expand Down
2 changes: 1 addition & 1 deletion reports/OresUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* sortlist tasks.
*/

const { bot, utils, log } = require('../botbase');
const {bot, utils, log} = require('../botbase');

module.exports = {

Expand Down
8 changes: 4 additions & 4 deletions reports/g13-1week.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -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' : '');

Expand Down
8 changes: 4 additions & 4 deletions reports/pending-afc.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { argv, bot, emailOnError, enwikidb, log, Mwn, TextExtractor } from "../botbase";
import {argv, bot, emailOnError, enwikidb, log, Mwn, TextExtractor} from "../botbase";
import {
AfcDraftSize,
comparators,
populateOresQualityRatings,
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() {

Expand Down
8 changes: 4 additions & 4 deletions utils.ts
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions webservice/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
6 changes: 3 additions & 3 deletions webservice/routes/articlesearch.ts
Original file line number Diff line number Diff line change
@@ -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();

Expand Down
6 changes: 3 additions & 3 deletions webservice/routes/logs.ts
Original file line number Diff line number Diff line change
@@ -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();

Expand Down

0 comments on commit af0e5f6

Please sign in to comment.