From 7ad7bb5d29071857e6951783cc4a95d98b9bb277 Mon Sep 17 00:00:00 2001 From: Igor Sudak Date: Thu, 18 Apr 2024 19:40:24 +0000 Subject: [PATCH] Several improvements - The preflight-summary GH workflow: don't post linter reports if they don't fit into the comment size limit - Dockerfiles: remove pip's cache in `~/.cache/pip` - Use `line length = 88 chars` for Pylint and Black --- .github/workflows/preflight-summary.yml | 10 ++++++---- Dockerfile.celery | 2 +- Dockerfile.scheduler | 6 +++--- pyproject.toml | 4 ++-- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/workflows/preflight-summary.yml b/.github/workflows/preflight-summary.yml index e020513..d92742b 100644 --- a/.github/workflows/preflight-summary.yml +++ b/.github/workflows/preflight-summary.yml @@ -57,11 +57,13 @@ jobs: cat {pylint,black,isort,bandit}-report.md > linter-reports.md 2>/dev/null || true if [[ -s linter-reports.md ]]; then printf "### Linter reports\n" - # Max size of comments on GitHub is 64KB. If the reports > 54KB, don't post them - if [[ $(stat --format=%s linter-reports.md) -gt 55296 ]]; then - printf "The reports are too big to be posted here.\n" - else + # Max size of comments on GitHub is 64KB. Don't post reports if they don't fit. + if awk '{sum += $1} END {exit sum > (62*1024)}' \ + <<< $(stat --format=%s test-summary.md code-coverage-results.md linter-reports.md) + then cat linter-reports.md + else + printf "The reports are too big to be posted here.\n" fi fi diff --git a/Dockerfile.celery b/Dockerfile.celery index 050fa9b..81eaa91 100644 --- a/Dockerfile.celery +++ b/Dockerfile.celery @@ -55,4 +55,4 @@ RUN <