Skip to content

Commit 8614016

Browse files
committed
tests: Correct formatting, update Claude with new instructions for branching
1 parent af2ce1a commit 8614016

3 files changed

Lines changed: 51 additions & 10 deletions

File tree

CLAUDE.md

Lines changed: 46 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -203,11 +203,52 @@ cd native/ecto_libsql && cargo test
203203

204204
### Development Cycle
205205

206-
1. Make changes to Elixir or Rust code
207-
2. Format: `mix format && cargo fmt`
208-
3. Run tests: `mix test && cargo test`
209-
4. Check formatting: `mix format --check-formatted`
210-
5. Commit with descriptive message
206+
#### Branch Strategy
207+
208+
**ALWAYS branch from `main`** for new work:
209+
210+
```bash
211+
git checkout main
212+
git pull origin main
213+
git checkout -b feature-descriptive-name # or bugfix-descriptive-name
214+
```
215+
216+
**Branch naming**:
217+
- Features: `feature-<descriptive-name>`
218+
- Bug fixes: `bugfix-<descriptive-name>`
219+
220+
**⚠️ CRITICAL: Preserving Untracked Files**
221+
222+
The repository often has untracked/uncommitted files (docs, notes, etc.) that must NOT be lost when switching branches. Git preserves untracked files across branch switches automatically, but:
223+
- **NEVER run `git clean`** without explicit user approval
224+
- **NEVER run `git checkout .`** or `git restore .` on the whole repo
225+
- **NEVER run `git reset --hard`** without explicit user approval
226+
- When switching branches, untracked files stay in place - this is expected
227+
228+
#### Development Steps
229+
230+
1. Create feature/bugfix branch from `main` (see above)
231+
2. Make changes to Elixir or Rust code
232+
3. ALWAYS format: `mix format --check-formatted && cargo fmt`
233+
4. Run tests: `mix test && cargo test`
234+
5. Fix any issues from formatting or tests
235+
6. **Commit ONLY files you touched** - other untracked files stay as-is
236+
237+
#### PR Workflow
238+
239+
All changes go through PRs to `main` (for review bot checks):
240+
241+
```bash
242+
git push -u origin feature-descriptive-name
243+
gh pr create --base main --title "feat: description" --body "..."
244+
```
245+
246+
After PR is merged, clean up:
247+
```bash
248+
git checkout main
249+
git pull origin main
250+
git branch -d feature-descriptive-name # Delete local branch
251+
```
211252

212253
### Adding a New NIF Function
213254

test/connection_features_test.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ defmodule EctoLibSql.ConnectionFeaturesTest do
219219

220220
test "reset allows connection reuse in pooled scenario", %{database: database} do
221221
# Simulate connection pool behaviour
222-
connections =
222+
connections =
223223
Enum.map(1..3, fn _ ->
224224
{:ok, state} = EctoLibSql.connect(database: database)
225225
state

test/statement_features_test.exs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -813,11 +813,11 @@ defmodule EctoLibSql.StatementFeaturesTest do
813813
assert {:ok, 2} = EctoLibSql.Native.stmt_column_count(state, stmt_id)
814814

815815
names = get_column_names(state, stmt_id, 2)
816-
assert names == ["id", "age_group"]
816+
assert names == ["id", "age_group"]
817817

818-
EctoLibSql.Native.close_stmt(stmt_id)
819-
end
820-
end
818+
EctoLibSql.Native.close_stmt(stmt_id)
819+
end
820+
end
821821

822822
# ============================================================================
823823
# Helper Functions

0 commit comments

Comments
 (0)