mirror of
https://github.com/OpenHands/OpenHands.git
synced 2025-12-26 05:48:36 +08:00
Move custom scripts docs (#8386)
Co-authored-by: openhands <openhands@all-hands.dev>
This commit is contained in:
parent
f8faa28bb1
commit
29f3e028e5
@ -99,13 +99,6 @@ check out our [documentation](https://docs.all-hands.dev/modules/usage/getting-s
|
||||
There you'll find resources on how to use different LLM providers,
|
||||
troubleshooting resources, and advanced configuration options.
|
||||
|
||||
### Custom Scripts
|
||||
|
||||
OpenHands supports custom scripts that run at different points in the runtime lifecycle:
|
||||
|
||||
- **setup.sh**: Place this script in the `.openhands` directory of your repository to run custom setup commands when the runtime initializes.
|
||||
- **pre-commit.sh**: Place this script in the `.openhands` directory to add a custom git pre-commit hook that runs before each commit. This can be used to enforce code quality standards, run tests, or perform other checks before allowing commits.
|
||||
|
||||
## 🤝 How to Join the Community
|
||||
|
||||
OpenHands is a community-driven project, and we welcome contributions from everyone. We do most of our communication
|
||||
|
||||
@ -21,3 +21,27 @@ sudo apt-get update
|
||||
sudo apt-get install -y lsof
|
||||
cd frontend && npm install ; cd ..
|
||||
```
|
||||
|
||||
## Pre-commit Script
|
||||
You can add a `.openhands/pre-commit.sh` file to create a custom git pre-commit hook that runs before each commit.
|
||||
This can be used to enforce code quality standards, run tests, or perform other checks before allowing commits.
|
||||
|
||||
For example:
|
||||
```bash
|
||||
#!/bin/bash
|
||||
# Run linting checks
|
||||
cd frontend && npm run lint
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Frontend linting failed. Please fix the issues before committing."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Run tests
|
||||
cd backend && pytest tests/unit
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Backend tests failed. Please fix the issues before committing."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
exit 0
|
||||
```
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user