Skip to content

[AgentOps][Code Quality] Improve formatting setup and requirement [1/n]#440

Merged
XinweiHe merged 4 commits intopivot/agentopsfrom
xinwei_format_improve_v1
Feb 9, 2026
Merged

[AgentOps][Code Quality] Improve formatting setup and requirement [1/n]#440
XinweiHe merged 4 commits intopivot/agentopsfrom
xinwei_format_improve_v1

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:06
@greptile-apps
Copy link

greptile-apps bot commented Feb 8, 2026

Greptile Overview

Greptile Summary

This PR consolidates and modernizes the formatting and linting infrastructure for both Python and frontend codebases.

Key improvements:

  • Replaced multiple Python formatters (yapf, isort, flake8, pyupgrade, autoflake) with unified Ruff tooling
  • Consolidated three separate GitHub Actions workflows (pre-commit.yml, npx-prettier.yml) into single lint.yml workflow
  • Added comprehensive frontend tooling: ESLint with TypeScript and React Hooks rules, Prettier with Tailwind CSS plugin
  • Simplified .pre-commit-config.yaml from 98 lines to 36 lines while maintaining functionality
  • Enhanced pyproject.toml with additional Ruff linters (N, SIM, RUF) and mypy configuration
  • Introduced lint-staged for efficient pre-commit checks on changed files only
  • Standardized lint/format scripts across frontend workspace packages (root, ui, worker)

Impact:

  • Faster pre-commit checks due to Ruff's performance and lint-staged optimization
  • Consistent code style enforcement across Python and TypeScript/React codebases
  • Reduced CI complexity with unified workflow
  • Better developer experience with modern tooling

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk - all changes are to development tooling configuration
  • All changes are limited to linting/formatting configuration files with no runtime code modifications. The consolidation replaces older tools with modern, well-tested alternatives (Ruff is widely adopted). The new CI workflow properly runs checks before merge, ensuring code quality is maintained.
  • No files require special attention

Important Files Changed

Filename Overview
.github/workflows/lint.yml Added unified CI workflow for Python (Ruff) and frontend (ESLint/Prettier) linting
.pre-commit-config.yaml Simplified pre-commit config, replaced yapf/isort/flake8 with Ruff, added lint-staged for frontend
frontend/.prettierrc Added Prettier configuration with Tailwind CSS plugin for consistent frontend formatting
frontend/eslint.config.mjs Added ESLint flat config with TypeScript, React Hooks rules, and proper ignores
frontend/package.json Added lint/format scripts and dependencies (ESLint, Prettier, lint-staged) at workspace root
pyproject.toml Enhanced Ruff configuration with additional linters, added mypy config, updated isort first-party packages

Sequence Diagram

sequenceDiagram
    participant Dev as Developer
    participant PreCommit as Pre-commit Hook
    participant CI as GitHub Actions CI
    participant Ruff as Ruff (Python)
    participant ESLint as ESLint (Frontend)
    participant Prettier as Prettier (Frontend)

    Dev->>PreCommit: git commit
    PreCommit->>PreCommit: Check file hygiene (EOL, trailing spaces)
    PreCommit->>Ruff: Run ruff check --fix
    PreCommit->>Ruff: Run ruff format
    alt Frontend files changed
        PreCommit->>ESLint: Run eslint --fix via lint-staged
        PreCommit->>Prettier: Run prettier --write via lint-staged
    end
    PreCommit-->>Dev: Commit accepted/rejected

    Dev->>CI: git push / create PR
    CI->>CI: Trigger lint.yml workflow
    
    par Python Job
        CI->>Ruff: ruff check
        CI->>Ruff: ruff format --check
        Ruff-->>CI: Pass/Fail
    and Frontend Job
        CI->>CI: Setup Node & pnpm
        CI->>CI: Install dependencies
        CI->>ESLint: pnpm run lint
        CI->>Prettier: pnpm run format:check
        ESLint-->>CI: Pass/Fail
        Prettier-->>CI: Pass/Fail
    end
    
    CI-->>Dev: Build status
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.

6 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@XinweiHe
Copy link
Collaborator Author

XinweiHe commented Feb 8, 2026

Will fix the linting error in a follow-up PR.

@XinweiHe XinweiHe merged commit 1363c65 into pivot/agentops Feb 9, 2026
2 of 4 checks passed
@XinweiHe XinweiHe deleted the xinwei_format_improve_v1 branch February 9, 2026 01:07
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