Skip to content

Fix/update linting checking and formatting#1978

Draft
yuriverweij wants to merge 3 commits intorobotframework:masterfrom
yuriverweij:fix/update-linting-checking-and-formatting
Draft

Fix/update linting checking and formatting#1978
yuriverweij wants to merge 3 commits intorobotframework:masterfrom
yuriverweij:fix/update-linting-checking-and-formatting

Conversation

@yuriverweij
Copy link
Copy Markdown
Member

@yuriverweij yuriverweij commented Apr 25, 2026

This pull request modernizes the codebase by updating the minimum supported Python version to 3.10, switching code formatting and linting from Black and flake8 to Ruff, and updating relevant documentation and configuration files. It also updates type annotations to use Python 3.10+ syntax and cleans up imports for better readability and maintainability.

Python version and compatibility updates:

  • Updated the minimum required Python version from 3.8 to 3.10 in documentation (README.rst, docs/index.html), packaging (setup.py), and CI configuration (.github/workflows/CI.yml). Removed references to unsupported versions and updated PyPy version to pypy-3.10.

Linting and formatting tool migration:

  • Replaced Black and flake8 with Ruff for code formatting and linting. Updated configuration files (pyproject.toml, .flake8 removed), development requirements (requirements-dev.txt), and documentation (CONTRIBUTING.rst) to reflect this change.

Type annotation modernization:

  • Updated type annotations throughout the codebase to use Python 3.10+ syntax (e.g., str | None instead of Optional[str], list[...] instead of List[...]).

General code cleanup and import improvements:

  • Cleaned up and reordered imports for clarity and consistency, and replaced deprecated or legacy constructs (e.g., using NamedTuple instead of namedtuple).

- Updated type hints to use the new syntax (e.g., `list[str]` instead of `List[str]`).
- Improved readability by replacing `isinstance` checks with more concise conditions.
- Simplified exception handling and error messages for better clarity.
- Enhanced the `WindowInfo` class by switching from `namedtuple` to `NamedTuple`.
- Streamlined the `get_window_infos` method to reduce redundancy.
- Replaced assertions in unit tests with assert statements for consistency.
- Updated the linting task to allow automatic fixing of issues.
- Removed unnecessary imports and cleaned up code formatting.
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