From dc700b2d1228376c8d3eb6ad3e790ff515a1a335 Mon Sep 17 00:00:00 2001 From: Taylor Steinberg Date: Mon, 4 Mar 2024 10:42:29 -0500 Subject: [PATCH] build: adds fix to pre-commit hooks (#66) --- .pre-commit-config.yaml | 4 ++++ Makefile | 4 ++++ examples/connect/streamlit/sample-content.py | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 142941f1..37a13007 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,6 +7,10 @@ repos: name: format entry: bash -c "make fmt" language: system + - id: fix + name: fix + entry: bash -c "make fix" + language: system - id: lint name: lint entry: bash -c "make lint" diff --git a/Makefile b/Makefile index 818b2997..d24c74c0 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,7 @@ PYTHON := python3 default deps fmt + fix install lint test @@ -45,6 +46,9 @@ deps: fmt: $(PYTHON) -m ruff format . +fix: + $(PYTHON) -m ruff check --fix + install: $(PIP) install -e . diff --git a/examples/connect/streamlit/sample-content.py b/examples/connect/streamlit/sample-content.py index f30cac64..a4a79daa 100644 --- a/examples/connect/streamlit/sample-content.py +++ b/examples/connect/streamlit/sample-content.py @@ -23,7 +23,7 @@ # Read the viewer's user session token from the streamlit ws header. headers = _get_websocket_headers() if headers: - USER_SESSION_TOKEN = headers.get("Posit-Connect-User-Session-Token") + USER_SESSION_TOKEN = headers.get("Posit-Connect-User-Session-Token") credentials_provider = viewer_credentials_provider( user_session_token=USER_SESSION_TOKEN