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
+37Lines changed: 37 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -198,6 +198,43 @@ After checking out the repo, run `bin/setup` to install dependencies. Then, run
198
198
199
199
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
200
200
201
+
### C Code Formatting
202
+
203
+
This project uses `clang-format` to enforce consistent formatting of C code with a `.clang-format` configuration in the root directory.
204
+
205
+
#### Setup
206
+
207
+
First, install clang-format:
208
+
209
+
```bash
210
+
# macOS
211
+
brew install clang-format
212
+
213
+
# Ubuntu/Debian
214
+
sudo apt-get install clang-format
215
+
216
+
# Windows
217
+
choco install llvm
218
+
```
219
+
220
+
#### Usage
221
+
222
+
Format all C source files:
223
+
224
+
```bash
225
+
rake format:c
226
+
```
227
+
228
+
Check formatting without making changes:
229
+
230
+
```bash
231
+
rake format:c_check
232
+
```
233
+
234
+
#### Editor Integration
235
+
236
+
For VS Code users, install the "clangd" extension which will automatically use the project's `.clang-format` file.
237
+
201
238
## Contributing
202
239
203
240
Bug reports and pull requests are welcome on GitHub at https://github.com/ruby/rbs.
0 commit comments