Skip to content

docs: add pre-commit setup guide to AGENTS.md#7838

Merged
Soulter merged 2 commits intoAstrBotDevs:masterfrom
Soulter:docs/agents-precommit-guide
Apr 27, 2026
Merged

docs: add pre-commit setup guide to AGENTS.md#7838
Soulter merged 2 commits intoAstrBotDevs:masterfrom
Soulter:docs/agents-precommit-guide

Conversation

@Soulter
Copy link
Copy Markdown
Member

@Soulter Soulter commented Apr 27, 2026

Summary

Extracts the pre-commit and ruff setup instructions from README.md into AGENTS.md so that AI agents have a complete reference for setting up the development environment without needing to read the full README.

Changes

File Change
AGENTS.md Added a new ## Pre-commit setup section between ## Setup commands and ## Dev environment tips

The new section covers:

  • What pre-commit hooks do (ruff-check, ruff-format, pyupgrade) with a link to .pre-commit-config.yaml
  • How to install and activate pre-commit hooks (pip install pre-commit && pre-commit install)
  • How to run ruff manually (ruff format . and ruff check .)
  • VSCode Ruff extension tip

Related

Content sourced from README.md (Development Environment section) and CONTRIBUTING.md.

Summary by Sourcery

Document pre-commit and Ruff setup for AI agents and improve dashboard tool/command tables usability by exposing full text via hover titles.

Enhancements:

  • Add title attributes to truncated tool and command description and origin name columns so users can view full text on hover in the dashboard tables.

Documentation:

  • Add a pre-commit setup section to AGENTS.md explaining Ruff-based hooks, installation, and editor integration for the development environment.

AstrBot Fixer and others added 2 commits April 27, 2026 14:29
…n WebUI

- CommandTable.vue: add :title binding to description div
- ToolTable.vue: add :title binding to description and origin_name divs

Fixes AstrBotDevs#7583 - Webui中超出显示长度的指令描述无法以任何方式看到
Extract the pre-commit and ruff setup instructions from README.md
into AGENTS.md so AI agents have a complete reference for
setting up the development environment.
@auto-assign auto-assign Bot requested review from LIghtJUNction and anka-afk April 27, 2026 06:53
@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Apr 27, 2026
Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • When binding :title to item.description / item.origin_name, consider falling back to an empty string (or the same '-' placeholder) to avoid showing undefined/null in the tooltip when these fields are missing.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- When binding `:title` to `item.description` / `item.origin_name`, consider falling back to an empty string (or the same `'-'` placeholder) to avoid showing `undefined`/`null` in the tooltip when these fields are missing.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds documentation for setting up pre-commit hooks using Ruff and improves the dashboard UI by adding title attributes for tooltips on truncated text. The review feedback suggests using uv for tool installation and execution to maintain consistency with the project's environment management. Furthermore, it is recommended to utilize the Vuetify text-truncate utility class instead of manual CSS styles for text overflow handling in the Vue components.

Comment thread AGENTS.md
Comment on lines +29 to +30
pip install pre-commit
pre-commit install
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Since the project uses uv for environment management (as seen in the Setup commands section), it is more consistent to use uv for tool installation. This ensures that tools are managed in a way that's compatible with the rest of the setup and avoids potential conflicts with system-wide pip installations.

Suggested change
pip install pre-commit
pre-commit install
uv tool install pre-commit
pre-commit install

Comment thread AGENTS.md
Comment on lines +36 to +37
ruff format .
ruff check .
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

To ensure the correct version of ruff (as managed by uv) is used, it is recommended to prefix these commands with uv run.

Suggested change
ruff format .
ruff check .
uv run ruff format .
uv run ruff check .


<template v-slot:item.description="{ item }">
<div class="text-body-2 text-medium-emphasis" style="max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">
<div class="text-body-2 text-medium-emphasis" style="max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;" :title="item.description">
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Vuetify provides a utility class text-truncate that handles overflow, text-overflow, and white-space properties. Using it makes the code cleaner and adheres to the principle of avoiding duplicated logic/styles.

        <div class="text-body-2 text-medium-emphasis text-truncate" style="max-width: 280px;" :title="item.description">
References
  1. When implementing similar functionality for different cases, refactor the logic into a shared helper (or in this case, a shared CSS class) to avoid code duplication.


<template #item.description="{ item }">
<div class="text-body-2 text-medium-emphasis" style="max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">
<div class="text-body-2 text-medium-emphasis" style="max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;" :title="item.description">
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Consider using the Vuetify utility class text-truncate instead of hardcoding the ellipsis styles. This improves maintainability by using shared framework utilities.

        <div class="text-body-2 text-medium-emphasis text-truncate" style="max-width: 320px;" :title="item.description">
References
  1. Refactor similar logic/styles into shared utilities to avoid code duplication.


<template #item.origin_name="{ item }">
<div class="text-body-2 text-medium-emphasis" style="max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">
<div class="text-body-2 text-medium-emphasis" style="max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;" :title="item.origin_name">
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Consider using the Vuetify utility class text-truncate instead of hardcoding the ellipsis styles.

        <div class="text-body-2 text-medium-emphasis text-truncate" style="max-width: 200px;" :title="item.origin_name">
References
  1. Refactor similar logic/styles into shared utilities to avoid code duplication.

@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Apr 27, 2026
@Soulter Soulter merged commit 72d6568 into AstrBotDevs:master Apr 27, 2026
21 checks passed
LIghtJUNction pushed a commit that referenced this pull request Apr 28, 2026
* fix(dashboard): add tooltip for truncated command/tool descriptions in WebUI

- CommandTable.vue: add :title binding to description div
- ToolTable.vue: add :title binding to description and origin_name divs

Fixes #7583 - Webui中超出显示长度的指令描述无法以任何方式看到

* docs: add pre-commit setup guide to AGENTS.md

Extract the pre-commit and ruff setup instructions from README.md
into AGENTS.md so AI agents have a complete reference for
setting up the development environment.

---------

Co-authored-by: AstrBot Fixer <astrbot@fix-bot.local>
Co-authored-by: AstrBot Fixer <astrbot-fixer@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants