-
Notifications
You must be signed in to change notification settings - Fork 1
Add search limit validation, typed models, and mypy strict CI #38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
clean6378-max-it
wants to merge
8
commits into
master
Choose a base branch
from
feat/typed-models-search-mypy
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
72f0f96
Add search limit validation, typed models, and mypy strict CI
clean6378-max-it a38b162
Fix PR review: stats exclusion, export_session errors, mypy 2.1, CI c…
clean6378-max-it d5153ad
Fix mypy CI errors in json_ok and export_api send_file stubs
clean6378-max-it 62e557c
fix(session_path): continue JSONL scan when display name peek fails
clean6378-max-it 46452dd
Fix: Single quote on Attribute
clean6378-max-it 41c1f09
fix(ui): early theme apply and safer search/sidebar click handlers
clean6378-max-it 46130cd
fix(api): address PR review — json_error, typed session rows, test li…
clean6378-max-it 9111174
fix(ci): repair mypy config and CI invocations for mypy 1.15
clean6378-max-it File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| """Shared Flask handler return types for mypy.""" | ||
|
|
||
| from typing import Any, Union, cast | ||
|
|
||
| from flask import Response, jsonify | ||
|
|
||
| # Narrow scope: handlers here return Response or (Response, status) only. | ||
| # Widen if adding (Response, int, headers) or plain-text tuples. | ||
| FlaskReturn = Union[Response, tuple[Response, int]] | ||
|
|
||
|
|
||
| def json_response(*args: Any, **kwargs: Any) -> Response: | ||
| """Typed wrapper around :func:`flask.jsonify` for JSON bodies.""" | ||
| return cast(Response, jsonify(*args, **kwargs)) | ||
|
|
||
|
|
||
| def json_error(payload: str | dict[str, Any], status: int) -> tuple[Response, int]: | ||
| """JSON error body with explicit HTTP status (avoids trailing `, 404` at call sites).""" | ||
| body: dict[str, Any] = {"error": payload} if isinstance(payload, str) else payload | ||
| return jsonify(body), status | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.