diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index babcb86a..8d898718 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -28,7 +28,7 @@ jobs: run: | echo "VALIDATE_ALL_CODEBASE=false" >> $GITHUB_ENV - name: Lint Code Base - uses: super-linter/super-linter/slim@v7 + uses: super-linter/super-linter/slim@v8 env: DEFAULT_BRANCH: main GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/test-website.yml b/.github/workflows/test-website.yml index 3619e4be..5a9fc583 100644 --- a/.github/workflows/test-website.yml +++ b/.github/workflows/test-website.yml @@ -35,7 +35,7 @@ jobs: - name: Use more complete checks for generated HTML linting run: cp -f .github/linters/.htmlhintrc_morechecks .github/linters/.htmlhintrc - name: Lint Generated HTML - uses: super-linter/super-linter/slim@v7 + uses: super-linter/super-linter/slim@v8 env: DEFAULT_BRANCH: main FILTER_REGEX_INCLUDE: static/html/.* diff --git a/server/faq.py b/server/faq.py index baeeec17..c02b3e56 100644 --- a/server/faq.py +++ b/server/faq.py @@ -1,5 +1,5 @@ -from collections import OrderedDict import re +from collections import OrderedDict ANCHOR_BIGQUERY = None @@ -26,7 +26,6 @@ def load_faq(): # Finds the first anchor whose question contains a given string. def find_anchor(query): - global anchors questions = [question for question in anchors if query.lower() in question.lower()] if len(questions): return anchors.get(questions[0]) diff --git a/server/reports.py b/server/reports.py index 1d430d42..62c2c161 100644 --- a/server/reports.py +++ b/server/reports.py @@ -2,7 +2,6 @@ from copy import deepcopy from time import time - from . import dates as date_util @@ -22,7 +21,6 @@ class VizTypes: def update_reports(): - global MAX_REPORT_STALENESS global last_report_update if (time() - last_report_update) < MAX_REPORT_STALENESS: @@ -40,28 +38,24 @@ def update_reports(): def get_reports(): - global reports_json update_reports() return list(map(get_report, reports_json.get("_reports"))) def get_featured_reports(): - global reports_json update_reports() return map(get_report, reports_json.get("_featured")) def map_reports(report_id): # pragma: no cover - global reports_json report = reports_json.get(report_id) report["id"] = report_id return report def get_report(report_id): - global reports_json report = reports_json.get(report_id) if not report: return None @@ -72,7 +66,6 @@ def get_report(report_id): def get_metric(metric_id): - global reports_json metrics = reports_json.get("_metrics") metric = deepcopy(metrics.get(metric_id)) if not metric: # pragma: no cover @@ -82,7 +75,6 @@ def get_metric(metric_id): def get_similar_reports(metric_id, current_report_id): - global reports_json similar_reports = {} reports = reports_json.get("_reports", []) for report_id in reports: @@ -98,16 +90,10 @@ def get_similar_reports(metric_id, current_report_id): def get_dates(): - global report_dates return report_dates def get_latest_date(metric_id): - global report_dates - global latest_metric_dates - global latest_metric_check - global MAX_REPORT_STALENESS - # Check the cache before hitting GCS. latest_date = latest_metric_dates.get(metric_id) if latest_date: # pragma: no cover @@ -128,7 +114,6 @@ def get_latest_date(metric_id): def get_lenses(): - global reports_json # TODO: Consider sorting the lenses by name. return reports_json.get("_lens", {}) diff --git a/server/techreport.py b/server/techreport.py index 6730d0c9..1591d9a3 100644 --- a/server/techreport.py +++ b/server/techreport.py @@ -8,7 +8,6 @@ def update_report(): def get_report(): - global tech_report_json update_report() return tech_report_json diff --git a/server/timestamps.py b/server/timestamps.py index 0bc40977..a04f3816 100644 --- a/server/timestamps.py +++ b/server/timestamps.py @@ -1,5 +1,5 @@ -import json import datetime +import json import logging timestamps_json = {} @@ -13,7 +13,6 @@ def update_config(): def get_timestamps_config(): - global timestamps_json return timestamps_json