Skip to content

Improve code quality by introducing/optimising coverage reporting, typechecking, formatting, linting etc.#46

Merged
adi-wan-askui merged 4 commits intomainfrom
static-code-analysis
May 1, 2025
Merged

Improve code quality by introducing/optimising coverage reporting, typechecking, formatting, linting etc.#46
adi-wan-askui merged 4 commits intomainfrom
static-code-analysis

Conversation

@adi-wan-askui
Copy link
Contributor

@adi-wan-askui adi-wan-askui commented May 1, 2025

  • chore: add test coverage reporting
  • chore: add typechecking with mypy & fix majority of type errors
  • chore: setup ruff and reformat & fix safe linting errors
  • ci: integrate typechecking & format checking into checks

Includes:

  • validate askui.models.askui.ai_element_utils.AiElement when
    deserializing from json
  • fix askui.models.askui.ai_element_utils.Rectangle
    (xmax was falsely named ymax)
  • fix askui.models.askui.ai_element_utils.AiElement.json_path
    (was falsely named metadata_path)
  • require prompt parameter of askui.locators.Prompt() to have at
    least 1 character
  • handle get() not being answered by model or incorrectly answered
    by introducing and raising new exceptions:
    • NoResponseToQueryError
    • UnexpectedResponseToQueryError
  • fix authorization in askui.tools.askui.askui_hub.AskUIHub
  • make askui.tools.askui.askui_controller more robust, e.g., by
    checking if stub has been initialized before using it

- exclude some modules (type errors) in `pyproject.toml`
  until modules are touched again
- validate `askui.models.askui.ai_element_utils.AiElement` when
  deserializing from json
- fix `askui.models.askui.ai_element_utils.Rectangle`
  (`xmax` was falsely named `ymax`)
- fix `askui.models.askui.ai_element_utils.AiElement.json_path`
  (was falsely named `metadata_path`)
- require prompt parameter of `askui.locators.Prompt()` to have at
  least 1 character
- handle `get()` not being answered by model or incorrectly answered
  by introducing and raising new exceptions:
  - `NoResponseToQueryError`
  - `UnexpectedResponseToQueryError`
- fix authorization in `askui.tools.askui.askui_hub.AskUIHub`
- make `askui.tools.askui.askui_controller` more robust, e.g., by
  checking if stub has been initialized before using it
@adi-wan-askui adi-wan-askui marked this pull request as ready for review May 1, 2025 13:14
- remove checks and fix all scripts as not all lint errors can be fixed at the moment
@adi-wan-askui adi-wan-askui force-pushed the static-code-analysis branch from d9ecf03 to a4495f2 Compare May 1, 2025 13:16
@adi-wan-askui adi-wan-askui merged commit de88d03 into main May 1, 2025
1 check passed
@adi-wan-askui adi-wan-askui deleted the static-code-analysis branch May 1, 2025 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant