From 61e8ffb12329defd9f23ba03b22e444292a491ab Mon Sep 17 00:00:00 2001 From: Guido Iaquinti <4038041+guidoiaquinti@users.noreply.github.com> Date: Fri, 18 Feb 2022 11:10:32 +0100 Subject: [PATCH] .github/workflows/ci-backend.yml: fix flake8 config (#8676) --- .github/workflows/ci-backend.yml | 9 +++------ posthog/utils.py | 4 ++-- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci-backend.yml b/.github/workflows/ci-backend.yml index e600151a506af..04534d47c36ef 100644 --- a/.github/workflows/ci-backend.yml +++ b/.github/workflows/ci-backend.yml @@ -95,14 +95,11 @@ jobs: black --check . isort --check-only . - - name: Lint with flake8 + - name: Check for errors and code style violations run: | - # stop the build if there are Python syntax errors or undefined names - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - # exit-zero treats all errors as warnings - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=120 --statistics + flake8 . - - name: Typecheck + - name: Check static typing run: | mypy . diff --git a/posthog/utils.py b/posthog/utils.py index 1502bcd78874d..33ab7bf656541 100644 --- a/posthog/utils.py +++ b/posthog/utils.py @@ -602,7 +602,7 @@ def queryset_to_named_query(qs: QuerySet, prepend: str = "") -> Tuple[str, dict] def get_instance_realm() -> str: """ Returns the realm for the current instance. `cloud` or 'demo' or `hosted-clickhouse`. - + Historically this would also have returned `hosted` for hosted postgresql based installations """ if settings.MULTI_TENANCY: @@ -810,7 +810,7 @@ def should_refresh(request: Request) -> bool: key = "refresh" return (request.query_params.get(key, "") or request.GET.get(key, "")).lower() == "true" or request.data.get( key, False - ) == True + ) is True def str_to_bool(value: Any) -> bool: