Skip to content

[AgentOps][Code Quality] Improve formatting setup and requirement [2/n]#441

Merged
XinweiHe merged 7 commits intopivot/agentopsfrom
xinwei_format_improve_v2
Feb 9, 2026
Merged

[AgentOps][Code Quality] Improve formatting setup and requirement [2/n]#441
XinweiHe merged 7 commits intopivot/agentopsfrom
xinwei_format_improve_v2

Conversation

@XinweiHe
Copy link
Collaborator

@XinweiHe XinweiHe commented Feb 8, 2026

Summary

Fixes #439

Type of Change

  • feat - A new feature
  • fix - A bug fix
  • docs - Documentation only changes
  • style - Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
  • refactor - A code change that neither fixes a bug nor adds a feature
  • perf - A code change that improves performance
  • test - Adding missing tests or correcting existing tests
  • build - Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
  • ci - Changes to our Cl configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
  • chore - Other changes that don't modify sc or test files
  • revert - Reverts a previous commit
  • security - A security fix or improvement
  • github - Changes to our GitHub configuration files and scripts
  • other (please describe):

Details

Screenshots / Recordings (if applicable)

Checklist

  • I have read the CONTRIBUTING.md
  • I have added/updated tests where applicable
  • I have added screenshots or recordings for UI changes (if applicable)
  • I have updated documentation where necessary

@XinweiHe XinweiHe requested a review from a team as a code owner February 8, 2026 23:53
@greptile-apps
Copy link

greptile-apps bot commented Feb 8, 2026

Greptile Overview

Greptile Summary

Applied comprehensive code formatting using ruff format for Python files and prettier for frontend TypeScript/React files. This PR enhances the codebase's formatting setup and enforces consistent code style across 141 files.

Key Changes:

  • Python Backend: Improved multi-line list/dict formatting, modernized type hints (list[] vs List[], collections.abc.Callable), changed timezone.utc to UTC import, better line breaks for readability
  • Frontend: Consolidated imports, standardized JSX formatting, removed trailing whitespace, consistent spacing in className attributes
  • Configuration: Added additional ruff linting rules to pyproject.toml (ignores for FastAPI patterns, zip, etc.), updated ESLint config to disable no-empty-object-type and ignore *.config.js files
  • Tooling: Improved tmux_tools with modern Python patterns (capture_output=True instead of separate stdout/stderr parameters)

All changes are purely cosmetic formatting improvements with no logic modifications. Previous threading comments have been addressed (Python 3.11 confirmed, SpanAttributes import fixed).

Confidence Score: 5/5

  • This PR is safe to merge with no risk - contains only automated formatting changes
  • Score of 5 reflects that all changes are purely cosmetic formatting improvements with zero logic modifications, previous review concerns have been addressed, and the changes improve code consistency across the entire codebase
  • No files require special attention

Important Files Changed

Filename Overview
pyproject.toml Added ruff linting rules and per-file ignores for better code quality enforcement
backend/db/clickhouse/client.py Formatting improvements: multi-line list comprehensions, changed timezone.utc to UTC import
backend/worker/transformer.py Formatting improvements with better line breaks and consistent spacing, UTC import change
traceroot-py/traceroot/init.py Reordered imports (moved openinference import to top) and consistent import formatting
traceroot-py/traceroot/decorators.py Fixed SpanAttributes import path, modernized type hints (collections.abc.Callable), formatting improvements
frontend/eslint.config.mjs Added no-empty-object-type rule, simplified ignores array, added *.config.js to ignores
tmux_tools/tmux.py Modernized type hints (list[] vs List[]), improved formatting, replaced stdout/stderr with capture_output

Sequence Diagram

sequenceDiagram
    participant Dev as Developer
    participant Ruff as Ruff Formatter (Python)
    participant Prettier as Prettier (Frontend)
    participant ESLint as ESLint
    participant Git as Git/Pre-commit

    Dev->>Git: Commits code changes
    Git->>Ruff: Run ruff format on Python files
    Ruff->>Ruff: Apply formatting rules
    Note over Ruff: - Multi-line list formatting<br/>- Import ordering<br/>- Modern type hints<br/>- UTC import instead of timezone.utc
    Ruff->>Git: Formatted Python code
    
    Git->>Prettier: Run prettier on frontend files
    Prettier->>Prettier: Apply formatting rules
    Note over Prettier: - Consistent spacing<br/>- Line breaks<br/>- Remove trailing whitespace
    Prettier->>Git: Formatted TS/React code
    
    Git->>ESLint: Run eslint --fix
    ESLint->>ESLint: Apply linting fixes
    Note over ESLint: - Auto-fixable issues<br/>- Code quality rules
    ESLint->>Git: Linted code
    
    Git->>Dev: All files formatted consistently
Loading

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

17 files reviewed, 3 comments

Edit Code Review Agent Settings | Greptile

Comment on lines +27 to 33
# Re-export using_attributes from OpenInference for convenience
from openinference.instrumentation import using_attributes

from traceroot.client import TracerootClient
from traceroot.context import get_current_trace_id, get_current_span_id
from traceroot.context import get_current_span_id, get_current_trace_id
from traceroot.decorators import observe
from traceroot.update import update_current_span, update_current_trace
Copy link

Choose a reason for hiding this comment

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

Eager openinference import

Moving from openinference.instrumentation import using_attributes to the top makes importing traceroot fail if openinference isn’t installed in an environment that only needs the core SDK. If openinference is an optional dependency, keep this import guarded (e.g., inside a try/except ImportError) or move it below other imports in a way that doesn’t break import traceroot.

Base automatically changed from xinwei_format_improve_v1 to pivot/agentops February 9, 2026 01:07
@XinweiHe XinweiHe force-pushed the xinwei_format_improve_v2 branch from ac5f07c to 15b64a6 Compare February 9, 2026 01:08
@XinweiHe
Copy link
Collaborator Author

XinweiHe commented Feb 9, 2026

@greptile review again

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

7 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@XinweiHe XinweiHe merged commit 026223b into pivot/agentops Feb 9, 2026
4 checks passed
@XinweiHe XinweiHe deleted the xinwei_format_improve_v2 branch February 9, 2026 01:15
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