Skip to content

Python: Add new linting rules to High-level client #302

Merged
alexluck-sift merged 15 commits intomainfrom
python/high-level-client-consistency-cleanup
Sep 5, 2025
Merged

Python: Add new linting rules to High-level client #302
alexluck-sift merged 15 commits intomainfrom
python/high-level-client-consistency-cleanup

Conversation

@alexluck-sift
Copy link
Collaborator

@alexluck-sift alexluck-sift commented Aug 29, 2025

Adds new rules to the high-level python client (scoped only to the sift_client module) ruff configuration to improve code quality and consistency.

Each commit represents the changes for each new rule that was added.

see python/lib/sift_client/.ruff.toml for new linting rules and their descriptions:

    # Core linting
    "F", # pyflakes - detect various errors
    "W", # pycodestyle warnings - style recommendations
    "B", # flake8-bugbear - detect potential bugs and design problems
    "PERF", # perflint - performance optimizations
    "RUF", # ruff-specific rules
    #     "ASYNC",  # flake8-async - async/await best practices # TODO

    # Code style and formatting
    "I", # isort - import sorting
    "N", # pep8-naming - naming conventions
    "C4", # flake8-comprehensions - better list/dict/set comprehensions
    "UP", # pyupgrade - modernize syntax to latest Python

    # Documentation
    "D", # pydocstyle - docstring style checking

    # Imports and modules
    "TID", # flake8-tidy-imports - import organization
    "INP", # flake8-no-pep420 - no implicit namespace packages

    # Type checking and annotations
    "FA", # flake8-future-annotations - necessary for backwards compatibility
    "TC", # flake8-type-checking - type checking best practices

    # Built-ins and standard library
    "A", # flake8-builtins - prevent overriding built-ins
    "DTZ", # flake8-datetimez - good timezone practices

    # Exception handling
    #    "TRY", # tryceratops - exception handling antipatterns # TODO: FD-102

    # Logging best practices
    #    "G", # flake8-logging-format - logging format best practices # TODO: FD-101
    "LOG", # flake8-logging - logging best practices

    # Tests
    #     "PT",     # flake8-pytest-style - pytest best practices # TODO: FD-59

Copy link
Contributor

@ian-sift ian-sift left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like a good move. How do new warnings look?

@alexluck-sift alexluck-sift force-pushed the python/high-level-client-consistency-cleanup branch from 0d9c3ce to 2a955d8 Compare August 30, 2025 17:13
@alexluck-sift alexluck-sift requested a review from ian-sift August 30, 2025 19:42
@alexluck-sift alexluck-sift merged commit 4dbb425 into main Sep 5, 2025
10 checks passed
@alexluck-sift alexluck-sift deleted the python/high-level-client-consistency-cleanup branch September 5, 2025 23:52
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.

2 participants