1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-10 22:59:17 +00:00

Simple formatting

This commit is contained in:
Tw93
2025-10-13 10:20:46 +08:00
parent 62537d8d44
commit f63f561673
6 changed files with 101 additions and 149 deletions

View File

@@ -3,36 +3,34 @@
## Setup
```bash
# Install tools
# Install development tools
brew install shfmt shellcheck bats-core
# Install git hooks (optional)
./scripts/install-hooks.sh
```
## Development
Run all quality checks before committing:
```bash
./scripts/check.sh
```
This command runs:
- Code formatting check
- ShellCheck linting
- Unit tests
Individual commands:
```bash
# Format code
./scripts/format.sh
# Run tests
# Run tests only
./tests/run.sh
# Check quality
shellcheck -S warning mole bin/*.sh lib/*.sh
```
## Git Hooks
Pre-commit hook will auto-format your code. Install with:
```bash
./scripts/install-hooks.sh
```
Skip if needed: `git commit --no-verify`
## Code Style
- Bash 3.2+ compatible
@@ -47,9 +45,8 @@ Config: `.editorconfig` and `.shellcheckrc`
1. Fork and create branch
2. Make changes
3. Format: `./scripts/format.sh`
4. Test: `./tests/run.sh`
5. Commit and push
6. Open PR
3. Run checks: `./scripts/check.sh`
4. Commit and push
5. Open PR
CI will check formatting, lint, and run tests.
CI will verify formatting, linting, and tests.