neuralmagic / guidellm

Evaluate and Enhance Your LLM Deployments for Real-World Inference Needs
Apache License 2.0
159 stars 11 forks source link

Expand ruff configurations to enforce comprehensive code quality standards #23

Closed markurtz closed 3 months ago

markurtz commented 3 months ago

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:

Test Plan: