[AgentOps][Code Quality] Improve formatting setup and requirement [2/n]#441
[AgentOps][Code Quality] Improve formatting setup and requirement [2/n]#441XinweiHe merged 7 commits intopivot/agentopsfrom
Conversation
Greptile OverviewGreptile SummaryApplied comprehensive code formatting using Key Changes:
All changes are purely cosmetic formatting improvements with no logic modifications. Previous threading comments have been addressed (Python 3.11 confirmed, Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
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
|
| # 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 |
There was a problem hiding this comment.
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.
ac5f07c to
15b64a6
Compare
|
@greptile review again |
Summary
Fixes #439
Type of Change
Details
Screenshots / Recordings (if applicable)
Checklist