From 9f369f69e94f35012c24a7e821a864da6c3f6f1b Mon Sep 17 00:00:00 2001 From: Cameron Chamberlain Date: Wed, 8 Apr 2020 19:17:17 +1000 Subject: [PATCH] enforce lowercase filenames (#653) --- .eslintrc.json | 6 ++++++ .github/workflows/status.yml | 2 +- package.json | 2 +- scripts/{statusSlackBot.js => status-slack-bot.js} | 2 +- scripts/{testTimezones.js => test-timezones.js} | 0 site/{crossCheckReport.js => cross-check-report.js} | 0 site/index.js | 2 +- src/shared/scrapers/US/{_USA-CDC.js => _usa-cdc.js} | 0 src/shared/scrapers/US/{NYT.js => nyt.js} | 0 .../US/{USA-COVIDTracking.js => usa-covidtracking.js} | 0 src/shared/scrapers/{JHU-USA.js => jhu-usa.js} | 0 src/shared/scrapers/{JHU.js => jhu.js} | 0 src/shared/timeseries/index.js | 2 +- src/shared/timeseries/{runCrawler.js => run-crawler.js} | 0 tools/{generateColors.js => generate-colors.js} | 0 tools/{generateCountyMap.js => generate-county-map.js} | 0 ...enerateCrosscheckHTML.js => generate-crosscheck-html.js} | 2 +- tools/{mapJHUCounties.js => map-jhu-counties.js} | 0 18 files changed, 12 insertions(+), 6 deletions(-) rename scripts/{statusSlackBot.js => status-slack-bot.js} (98%) rename scripts/{testTimezones.js => test-timezones.js} (100%) rename site/{crossCheckReport.js => cross-check-report.js} (100%) rename src/shared/scrapers/US/{_USA-CDC.js => _usa-cdc.js} (100%) rename src/shared/scrapers/US/{NYT.js => nyt.js} (100%) rename src/shared/scrapers/US/{USA-COVIDTracking.js => usa-covidtracking.js} (100%) rename src/shared/scrapers/{JHU-USA.js => jhu-usa.js} (100%) rename src/shared/scrapers/{JHU.js => jhu.js} (100%) rename src/shared/timeseries/{runCrawler.js => run-crawler.js} (100%) rename tools/{generateColors.js => generate-colors.js} (100%) rename tools/{generateCountyMap.js => generate-county-map.js} (100%) rename tools/{generateCrosscheckHTML.js => generate-crosscheck-html.js} (90%) rename tools/{mapJHUCounties.js => map-jhu-counties.js} (100%) diff --git a/.eslintrc.json b/.eslintrc.json index e7357e6ae..c1eb4a047 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -41,6 +41,12 @@ "no-restricted-syntax": "off", "no-shadow": "off", "no-underscore-dangle": "off", + "unicorn/filename-case": [ + "error", + { + "case": "kebabCase" + } + ], "unicorn/prefer-includes": "error" } } diff --git a/.github/workflows/status.yml b/.github/workflows/status.yml index bf49f855a..055aed21f 100644 --- a/.github/workflows/status.yml +++ b/.github/workflows/status.yml @@ -45,4 +45,4 @@ jobs: RUN_NUMBER: ${{ github.run_id }} SLACK_STATUS_HOOK: ${{ secrets.SLACK_STATUS_HOOK }} run: | - node ./scripts/statusSlackBot.js send ${SLACK_STATUS_HOOK} + node ./scripts/status-slack-bot.js send ${SLACK_STATUS_HOOK} diff --git a/package.json b/package.json index d12b3c633..e3181ff70 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "qa": "pta ./src/qa/*.qa.js -r log | node src/qa/utils/qa-reporter.js", "test": "tape tests/**/*-test.js | tap-spec", "test:watch": "tape-watch tests/**/*-test.js -p tap-spec", - "test:tz": "tape scripts/testTimezones.js | tap-spec", + "test:tz": "tape scripts/test-timezones.js | tap-spec", "timeseries": "node src/shared/timeseries/index.js", "update": "npm run updateModules && rm -rf cache/* && npm run start", "updateModules": "git submodule update --remote", diff --git a/scripts/statusSlackBot.js b/scripts/status-slack-bot.js similarity index 98% rename from scripts/statusSlackBot.js rename to scripts/status-slack-bot.js index f27a3161f..98b3fcdc3 100644 --- a/scripts/statusSlackBot.js +++ b/scripts/status-slack-bot.js @@ -7,7 +7,7 @@ const fs = imports('../src/shared/lib/fs.js'); const datetime = imports('../src/shared/lib/datetime/index.js').default; const { argv } = yargs - .scriptName('node ./scripts/statusSlackBot.js') + .scriptName('node ./scripts/status-slack-bot.js') .usage('$0 [args]') .command('send [hook]', 'sends report.json to provided Slack Hook', yargs => { yargs.positional('hook', { diff --git a/scripts/testTimezones.js b/scripts/test-timezones.js similarity index 100% rename from scripts/testTimezones.js rename to scripts/test-timezones.js diff --git a/site/crossCheckReport.js b/site/cross-check-report.js similarity index 100% rename from site/crossCheckReport.js rename to site/cross-check-report.js diff --git a/site/index.js b/site/index.js index adf452e96..e23745dcc 100644 --- a/site/index.js +++ b/site/index.js @@ -8,7 +8,7 @@ import './style.css'; import showMap from './map.js'; import showFile from './file.js'; import showSources from './sources.js'; -import showCrossCheckReport from './crossCheckReport.js'; +import showCrossCheckReport from './cross-check-report.js'; const pages = { '#home': '.cds-Home', diff --git a/src/shared/scrapers/US/_USA-CDC.js b/src/shared/scrapers/US/_usa-cdc.js similarity index 100% rename from src/shared/scrapers/US/_USA-CDC.js rename to src/shared/scrapers/US/_usa-cdc.js diff --git a/src/shared/scrapers/US/NYT.js b/src/shared/scrapers/US/nyt.js similarity index 100% rename from src/shared/scrapers/US/NYT.js rename to src/shared/scrapers/US/nyt.js diff --git a/src/shared/scrapers/US/USA-COVIDTracking.js b/src/shared/scrapers/US/usa-covidtracking.js similarity index 100% rename from src/shared/scrapers/US/USA-COVIDTracking.js rename to src/shared/scrapers/US/usa-covidtracking.js diff --git a/src/shared/scrapers/JHU-USA.js b/src/shared/scrapers/jhu-usa.js similarity index 100% rename from src/shared/scrapers/JHU-USA.js rename to src/shared/scrapers/jhu-usa.js diff --git a/src/shared/scrapers/JHU.js b/src/shared/scrapers/jhu.js similarity index 100% rename from src/shared/scrapers/JHU.js rename to src/shared/scrapers/jhu.js diff --git a/src/shared/timeseries/index.js b/src/shared/timeseries/index.js index 76e97a605..c9c29a096 100644 --- a/src/shared/timeseries/index.js +++ b/src/shared/timeseries/index.js @@ -7,7 +7,7 @@ const fs = imports('../lib/fs.js'); const transform = imports('../lib/transform.js'); const geography = imports('../lib/geography/index.js'); const datetime = imports('../lib/datetime/index.js').default; -const runCrawler = imports('./runCrawler.js').default; +const runCrawler = imports('./run-crawler.js').default; const clearAllTimeouts = imports('../utils/timeouts.js').default; diff --git a/src/shared/timeseries/runCrawler.js b/src/shared/timeseries/run-crawler.js similarity index 100% rename from src/shared/timeseries/runCrawler.js rename to src/shared/timeseries/run-crawler.js diff --git a/tools/generateColors.js b/tools/generate-colors.js similarity index 100% rename from tools/generateColors.js rename to tools/generate-colors.js diff --git a/tools/generateCountyMap.js b/tools/generate-county-map.js similarity index 100% rename from tools/generateCountyMap.js rename to tools/generate-county-map.js diff --git a/tools/generateCrosscheckHTML.js b/tools/generate-crosscheck-html.js similarity index 90% rename from tools/generateCrosscheckHTML.js rename to tools/generate-crosscheck-html.js index 448fa6de9..643f835f5 100644 --- a/tools/generateCrosscheckHTML.js +++ b/tools/generate-crosscheck-html.js @@ -1,6 +1,6 @@ const imports = require('esm')(module); -const { generateCrossCheckPage } = imports('../site/crossCheckReport.js'); +const { generateCrossCheckPage } = imports('../site/cross-check-report.js'); const fs = imports('../src/shared/lib/fs.js'); // eslint-disable-next-line import/no-unresolved const report = require('../dist/report.json'); diff --git a/tools/mapJHUCounties.js b/tools/map-jhu-counties.js similarity index 100% rename from tools/mapJHUCounties.js rename to tools/map-jhu-counties.js