Skip to content

Enhance documentation and refactor code for variant CLI tools - #2

Open
Ralnoc wants to merge 6 commits into
mainfrom
VMT-1
Open

Enhance documentation and refactor code for variant CLI tools#2
Ralnoc wants to merge 6 commits into
mainfrom
VMT-1

Conversation

@Ralnoc

@Ralnoc Ralnoc commented May 15, 2026

Copy link
Copy Markdown
Contributor

This pull request primarily improves code quality and maintainability through enhanced type annotations, docstring standardization, and code style adjustments. It also updates project configuration files for better IDE support and modernizes tool settings. The most important changes are grouped below:

Code Quality and Type Annotations:

  • Replaced generic or untyped function signatures with explicit type annotations, such as using Dict[str, Any], List[str], and list[tuple[str, str]] throughout the codebase for improved type safety and clarity. [1] [2] [3] [4] [5]
  • Updated variable declarations to use explicit types, e.g., user_filters: Dict[str, List[str]] and group_states: list[list[str]]. [1] [2]

Docstring and Documentation Standardization:

  • Rewrote and standardized docstrings to a concise, parameterized format with clear :param: and :return: sections, replacing older, verbose docstring styles. This applies to functions in show_variants.py, loader.py, validation.py, and variants.py. [1] [2] [3] [4] [5] [6] [7] [8]

Code Style and Minor Refactoring:

  • Reformatted code for better readability and consistency, such as combining list comprehensions into single lines, simplifying logic, and updating argument handling. [1] [2] [3]
  • Added missing if __name__ == "__main__": guard to show_variants.py for standalone execution.

IDE and Project Configuration:

  • Added .idea/pySourceRootDetection.xml to define src and tests as source roots for PyCharm.
  • Enhanced .idea/vcs.xml with GitHub issue navigation links to improve developer workflow.

Tooling and Linting Configuration:

  • Increased line length limits to 120 in Black, isort, and flake8 configurations, and updated exclusions and Python version targets in pyproject.toml for improved compatibility and code style alignment. [1] [2] [3] [4]

These changes collectively improve maintainability, developer experience, and codebase consistency.

Ralnoc and others added 6 commits May 14, 2026 11:36
- Improve function docstrings with parameter/return annotations
- Add detailed CLI entrypoint documentation for argv handling
- Update VCS configuration with enhanced issue navigation links
- Add PyCharm source root detection for project structure
…r definition in show_variants.py

Updated the JSON loading process in `loader.py` to store the parsed data in a `payload` variable before returning it, enhancing clarity. Cleaned up the function definition in `show_variants.py` by removing unnecessary type ignore comments for the `_build_parser` function, improving code readability.

# Change Details
* `loader.py`
  * Refactored JSON loading to use a `payload` variable for clarity before returning the parsed data.
* `show_variants.py`
  * Removed unnecessary type ignore comment from the `_build_parser` function definition.
…r definition in show_variants.py

Updated the JSON loading process in `loader.py` to store the parsed data in a `payload` variable before returning it, enhancing clarity. Cleaned up the function definition in `show_variants.py` by removing unnecessary type ignore comments for the `_build_parser` function, improving code readability.

# Change Details
* `loader.py`
  * Refactored JSON loading to use a `payload` variable for clarity before returning the parsed data.
* `show_variants.py`
  * Removed unnecessary type ignore comment from the `_build_parser` function definition.
Introduce a main function in `show_variants.py` to serve as the entry point for executing the script directly. This change allows for improved modularity and usability when running the script independently.

# Change Details
* `show_variants.py`
  * Added a `main` function to serve as the entry point for the script when executed directly.
… style consistency

Updated type hints in `loader.py`, `show_variants.py`, and `validation.py` to use more specific types, enhancing code clarity and type checking. Adjusted line length settings in `pyproject.toml`, `tox.ini`, and `flake8` configuration to standardize at 120 characters, improving readability. Cleaned up argument parsing logic in `show_variants.py` and ensured consistent formatting across various files.

# Change Details
* `core/loader.py`
  * Refactored type hint for `load_vs_json` function to use `Dict[str, Any]`
* `core/show_variants.py`
  * Updated type hint for `_build_parser` function to use `Dict[str, Any]`
* `core/validation.py`
  * Refactored type hint for `group_states` to use `dict[str, list[str]]`
* `pyproject.toml`
  * Changed line length setting to 120 characters and added support for Python 3.12-3.14
* `tox.ini`
  * Updated line length setting to 120 characters and added new Python versions for testing
* `test/test_loader.py`
  * Simplified byte string writing for BOM test case
* `test/test_show_variants.py`
  * Cleaned up formatting in test function definitions
@github-actions

github-actions Bot commented May 15, 2026

Copy link
Copy Markdown

Qodana for Python

1 new problem were found

Inspection name Severity Problems
Invalid type hints definitions and usages 🔶 Warning 1

☁️ View the detailed Qodana report

Contact Qodana team

Contact us at qodana-support@jetbrains.com

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