You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+42Lines changed: 42 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,6 +17,48 @@ LiteVault Owner can change the Authorizer contract, which will enable a grace wi
17
17
18
18
Authorizer contract that authorize withdrawal regardless of token and amount, but only outside of the time range specified on deployment.
19
19
20
+
## Development Setup
21
+
22
+
### Code Formatting
23
+
24
+
This project uses `forge fmt` for consistent Solidity code formatting. We follow an editor-agnostic approach with additional convenience settings for VS Code users.
25
+
26
+
#### Editor-Agnostic Formatting
27
+
28
+
1.**Git Hooks**: The project includes pre-commit hooks that automatically format Solidity files using `forge fmt` before each commit.
29
+
30
+
To set up the pre-commit hook:
31
+
32
+
```bash
33
+
# Configure git to use the hooks in the .githooks directory
34
+
git config core.hooksPath .githooks
35
+
```
36
+
37
+
2.**EditorConfig**: The project includes an `.editorconfig` file with basic formatting rules that many editors support.
38
+
39
+
To use these settings:
40
+
41
+
- Install an EditorConfig plugin for your editor if it doesn't have built-in support
42
+
- The plugin will automatically apply basic formatting rules (indentation, line endings, etc.)
43
+
44
+
More information about EditorConfig can be found at [https://editorconfig.org/](https://editorconfig.org/)
45
+
46
+
#### VS Code-Specific Settings
47
+
48
+
For VS Code users, additional settings are provided in `.vscode/settings.json` that:
49
+
50
+
- Configure VS Code to use `forge fmt` automatically when saving Solidity files
51
+
- Ensure consistent formatting directly in the editor
52
+
53
+
These settings are optional and only apply to VS Code users. Other editors may need their own configuration to exactly match `forge fmt` behavior.
54
+
55
+
#### Recommended Workflow
56
+
57
+
The recommended workflow for all developers, regardless of editor:
58
+
59
+
1. Use the pre-commit hooks to ensure consistent formatting in the repository
60
+
2. If needed, run `forge fmt` manually before committing to see changes
61
+
20
62
## Deployment and interaction
21
63
22
64
This repository uses Foundry toolchain for development, testing and deployment.
0 commit comments