Skip to content
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

Expand ruff configurations to enforce comprehensive code quality standards #23

Merged
merged 5 commits into from
Aug 2, 2024

Conversation

markurtz
Copy link
Member

Summary

Enhances our ruff configurations to enforce comprehensive standards across various aspects of code quality, including style, formatting, structure, complexity, security, bug prevention, and documentation.

Details

Changes Implemented:

  1. Code Style and Formatting:
    • Enforced PEP 8 conventions, including spacing, indentation, and line length.
    • Included isort for consistent import sorting.
    • Added rules for trailing commas, commented-out code, import conventions, naming conventions, and quote usage.
  2. Code Structure and Complexity:
    • Simplified complex expressions and improved readability.
    • Applied best practices for list, set, and dict comprehensions.
    • Checked for overly complex code using cyclomatic complexity.
  3. Code Security and Bug Prevention:
    • Detected unused function arguments, boolean traps, and implicit string concatenations.
    • Prevented common programming mistakes and potential bugs.
    • Enforced correct exception handling and detected security issues.
  4. Code Documentation:
    • Ensured adherence to documentation standards.
    • Detected unresolved FIXMEs and other temporary comments.

Files Modified:

  • .pre-commit-config.yaml: Updated configurations to include new ruff rules and standards.
  • pyproject.toml: Extended ruff linting rules to cover additional checks for various code quality aspects.
  • Source and test files: Applied necessary changes to comply with the new ruff configurations, including refactoring code, updating documentation, and adding comments.

Test Plan:

  • Automated Testing:
    • Automated tests updated to run the latest changes
  • Manual Testing:
    • Manually reviewed changes to ensure they align with the updated linting standards.
    • Manually ran tests and checks

@markurtz markurtz self-assigned this Jul 29, 2024
parfeniukink
parfeniukink previously approved these changes Jul 29, 2024
src/guidellm/backend/base.py Show resolved Hide resolved
src/guidellm/backend/openai.py Outdated Show resolved Hide resolved
@markurtz markurtz force-pushed the ruff-formatting branch 2 times, most recently from 12d6f75 to 7a4bb5e Compare August 2, 2024 14:02
@parfeniukink parfeniukink self-requested a review August 2, 2024 14:20
@parfeniukink parfeniukink self-requested a review August 2, 2024 14:21
parfeniukink
parfeniukink previously approved these changes Aug 2, 2024
…style and formatting, code structure and complexity, code security and bug prevention, and code documentation. This includes simple things like isort and more complicated ones
@markurtz markurtz merged commit a09623b into main Aug 2, 2024
9 checks passed
@markurtz markurtz deleted the ruff-formatting branch August 2, 2024 17:47
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