Skip to content

Commit a7a8a7e

Browse files
committed
Run manual hooks format with prettier
Remove hook "pretty-format-json" was conflicting with "prettier"
1 parent cfc83bb commit a7a8a7e

File tree

12 files changed

+354
-360
lines changed

12 files changed

+354
-360
lines changed

.github/linters/mlc_config.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
{
22
"retryOn429": true,
33
"retryCount": 3,
4-
"aliveStatusCodes": [
5-
200,
6-
206,
7-
502
8-
],
4+
"aliveStatusCodes": [200, 206, 502],
95
"ignorePatterns": [
106
{
117
"pattern": "^https://github.com/mruby/mruby/commit/"

.pre-commit-config.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ repos:
5555
- id: check-executables-have-shebangs
5656
exclude: ^test/t/lang\.rb$
5757
- id: check-illegal-windows-names
58-
- id: pretty-format-json
59-
args: [--autofix, --no-sort-keys]
6058
- id: check-json
6159
- id: check-merge-conflict
6260
- id: check-shebang-scripts-are-executable

doc/README.md

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4,59 +4,59 @@
44

55
New to mruby? Start here:
66

7-
| Document | Description |
8-
| -------- | ----------- |
7+
| Document | Description |
8+
| -------------------------------------------- | -------------------------------------- |
99
| [Getting Started](guides/getting-started.md) | Build mruby and run your first program |
10-
| [Language Features](guides/language.md) | Ruby subset supported by mruby |
11-
| [Limitations](limitations.md) | Behavioral differences from CRuby |
10+
| [Language Features](guides/language.md) | Ruby subset supported by mruby |
11+
| [Limitations](limitations.md) | Behavioral differences from CRuby |
1212

1313
## Guides (for embedders and gem authors)
1414

1515
### Embedding mruby in C
1616

17-
| Document | Description |
18-
| -------- | ----------- |
19-
| [C API Reference](guides/capi.md) | Values, classes, methods, error handling, fibers |
20-
| [GC Arena](guides/gc-arena-howto.md) | Managing temporary objects in C extensions |
21-
| [Linking](guides/link.md) | Linking with `libmruby` |
22-
| [Amalgamation](guides/amalgamation.md) | Single-file build for easy integration |
23-
| [Precompiled Symbols](guides/symbol.md) | Compile-time symbol allocation |
17+
| Document | Description |
18+
| --------------------------------------- | ------------------------------------------------ |
19+
| [C API Reference](guides/capi.md) | Values, classes, methods, error handling, fibers |
20+
| [GC Arena](guides/gc-arena-howto.md) | Managing temporary objects in C extensions |
21+
| [Linking](guides/link.md) | Linking with `libmruby` |
22+
| [Amalgamation](guides/amalgamation.md) | Single-file build for easy integration |
23+
| [Precompiled Symbols](guides/symbol.md) | Compile-time symbol allocation |
2424

2525
### Building and Configuring
2626

27-
| Document | Description |
28-
| -------- | ----------- |
29-
| [Compilation](guides/compile.md) | Build system, cross-compilation, toolchains |
30-
| [Build Configuration](guides/mrbconf.md) | Compile-time macros (`MRB_*` flags) |
31-
| [mrbgems](guides/mrbgems.md) | Creating and managing gems |
32-
| [Memory](guides/memory.md) | Allocator customization and heap regions |
27+
| Document | Description |
28+
| ---------------------------------------- | ------------------------------------------- |
29+
| [Compilation](guides/compile.md) | Build system, cross-compilation, toolchains |
30+
| [Build Configuration](guides/mrbconf.md) | Compile-time macros (`MRB_*` flags) |
31+
| [mrbgems](guides/mrbgems.md) | Creating and managing gems |
32+
| [Memory](guides/memory.md) | Allocator customization and heap regions |
3333

3434
### Tools
3535

36-
| Document | Description |
37-
| -------- | ----------- |
38-
| [Debugger](guides/debugger.md) | Using `mrdb` for debugging |
36+
| Document | Description |
37+
| ----------------------------------------------- | ----------------------------------------------- |
38+
| [Debugger](guides/debugger.md) | Using `mrdb` for debugging |
3939
| [ROM Method Tables](guides/rom-method-table.md) | Read-only method tables for constrained devices |
4040

4141
### Reference
4242

43-
| Document | Description |
44-
| -------- | ----------- |
43+
| Document | Description |
44+
| ------------------------------------- | ------------------ |
4545
| [Directory Structure](guides/hier.md) | Source tree layout |
4646

4747
## Internals (for mruby contributors)
4848

4949
Start with [Architecture](internal/architecture.md) for an overview,
5050
then dive into the subsystem you need:
5151

52-
| Document | Description |
53-
| -------- | ----------- |
54-
| [Architecture](internal/architecture.md) | Overview of object model, VM, GC, compiler |
55-
| [Virtual Machine](internal/vm.md) | Dispatch loop, call frames, method lookup, fibers |
56-
| [Garbage Collector](internal/gc.md) | Tri-color marking, write barriers, generational GC |
57-
| [Compiler Pipeline](internal/compiler.md) | Parser, code generator, IRep, binary format |
58-
| [Opcodes](internal/opcode.md) | VM instruction set reference |
59-
| [Value Boxing](internal/boxing.md) | How `mrb_value` encodes types |
52+
| Document | Description |
53+
| ----------------------------------------- | -------------------------------------------------- |
54+
| [Architecture](internal/architecture.md) | Overview of object model, VM, GC, compiler |
55+
| [Virtual Machine](internal/vm.md) | Dispatch loop, call frames, method lookup, fibers |
56+
| [Garbage Collector](internal/gc.md) | Tri-color marking, write barriers, generational GC |
57+
| [Compiler Pipeline](internal/compiler.md) | Parser, code generator, IRep, binary format |
58+
| [Opcodes](internal/opcode.md) | VM instruction set reference |
59+
| [Value Boxing](internal/boxing.md) | How `mrb_value` encodes types |
6060

6161
## Release Notes
6262

doc/guides/capi.md

Lines changed: 68 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -99,23 +99,23 @@ mrb_str_to_cstr(mrb, v) /* const char* from String value */
9999

100100
### Value Types
101101

102-
| `mrb_vtype` | Ruby Class | Notes |
103-
| ----------- | ---------- | ----- |
104-
| `MRB_TT_FALSE` | FalseClass/NilClass | `nil` has `MRB_TT_FALSE` |
105-
| `MRB_TT_TRUE` | TrueClass | |
106-
| `MRB_TT_INTEGER` | Integer | Immediate value |
107-
| `MRB_TT_FLOAT` | Float | May be immediate |
108-
| `MRB_TT_SYMBOL` | Symbol | Immediate value |
109-
| `MRB_TT_STRING` | String | Heap object |
110-
| `MRB_TT_ARRAY` | Array | Heap object |
111-
| `MRB_TT_HASH` | Hash | Heap object |
112-
| `MRB_TT_OBJECT` | Object | User-defined classes |
113-
| `MRB_TT_CLASS` | Class | |
114-
| `MRB_TT_MODULE` | Module | |
115-
| `MRB_TT_PROC` | Proc | |
116-
| `MRB_TT_CDATA` | (C data) | Wrapped C structs |
117-
| `MRB_TT_EXCEPTION` | Exception | |
118-
| `MRB_TT_FIBER` | Fiber | |
102+
| `mrb_vtype` | Ruby Class | Notes |
103+
| ------------------ | ------------------- | ------------------------ |
104+
| `MRB_TT_FALSE` | FalseClass/NilClass | `nil` has `MRB_TT_FALSE` |
105+
| `MRB_TT_TRUE` | TrueClass | |
106+
| `MRB_TT_INTEGER` | Integer | Immediate value |
107+
| `MRB_TT_FLOAT` | Float | May be immediate |
108+
| `MRB_TT_SYMBOL` | Symbol | Immediate value |
109+
| `MRB_TT_STRING` | String | Heap object |
110+
| `MRB_TT_ARRAY` | Array | Heap object |
111+
| `MRB_TT_HASH` | Hash | Heap object |
112+
| `MRB_TT_OBJECT` | Object | User-defined classes |
113+
| `MRB_TT_CLASS` | Class | |
114+
| `MRB_TT_MODULE` | Module | |
115+
| `MRB_TT_PROC` | Proc | |
116+
| `MRB_TT_CDATA` | (C data) | Wrapped C structs |
117+
| `MRB_TT_EXCEPTION` | Exception | |
118+
| `MRB_TT_FIBER` | Fiber | |
119119

120120
## Defining Classes and Modules
121121

@@ -165,15 +165,15 @@ mrb_define_module_function(mrb, mod, "name", my_method, MRB_ARGS_ANY());
165165
166166
### Argument Specifiers
167167
168-
| Macro | Meaning |
169-
| ----- | ------- |
170-
| `MRB_ARGS_NONE()` | No arguments |
171-
| `MRB_ARGS_REQ(n)` | `n` required arguments |
172-
| `MRB_ARGS_OPT(n)` | `n` optional arguments |
173-
| `MRB_ARGS_ARG(r,o)` | `r` required + `o` optional |
174-
| `MRB_ARGS_REST()` | Splat (`*args`) |
175-
| `MRB_ARGS_BLOCK()` | Block (`&block`) |
176-
| `MRB_ARGS_ANY()` | Any number (same as REST) |
168+
| Macro | Meaning |
169+
| ---------------------- | ------------------------------------- |
170+
| `MRB_ARGS_NONE()` | No arguments |
171+
| `MRB_ARGS_REQ(n)` | `n` required arguments |
172+
| `MRB_ARGS_OPT(n)` | `n` optional arguments |
173+
| `MRB_ARGS_ARG(r,o)` | `r` required + `o` optional |
174+
| `MRB_ARGS_REST()` | Splat (`*args`) |
175+
| `MRB_ARGS_BLOCK()` | Block (`&block`) |
176+
| `MRB_ARGS_ANY()` | Any number (same as REST) |
177177
| `MRB_ARGS_KEY(n,rest)` | `n` keyword args, `rest`=1 for `**kw` |
178178
179179
These can be combined with `|`:
@@ -192,27 +192,27 @@ mrb_int mrb_get_args(mrb_state *mrb, const char *format, ...);
192192
193193
### Format Specifiers
194194
195-
| Spec | Ruby Type | C Type(s) | Notes |
196-
| ---- | --------- | --------- | ----- |
197-
| `o` | any | `mrb_value` | No type check |
198-
| `i` | Numeric | `mrb_int` | Coerces to integer |
199-
| `f` | Numeric | `mrb_float` | Coerces to float |
200-
| `b` | any | `mrb_bool` | Truthiness |
201-
| `n` | String/Symbol | `mrb_sym` | Converts to symbol |
202-
| `s` | String | `const char*, mrb_int` | Pointer + length |
203-
| `z` | String | `const char*` | Null-terminated |
204-
| `S` | String | `mrb_value` | String value |
205-
| `A` | Array | `mrb_value` | Array value |
206-
| `H` | Hash | `mrb_value` | Hash value |
207-
| `C` | Class | `mrb_value` | Class/Module value |
208-
| `c` | Class | `struct RClass*` | Class pointer |
209-
| `a` | Array | `const mrb_value*, mrb_int` | Array pointer + length |
210-
| `d` | C Data | `void*` | Requires `mrb_data_type*` |
211-
| `&` | Block | `mrb_value` | Block argument |
212-
| `*` | rest | `const mrb_value*, mrb_int` | Rest arguments |
213-
| `\|` | — | — | Following args are optional |
214-
| `?` | — | `mrb_bool` | Was previous optional arg given? |
215-
| `:` | keywords | `mrb_kwargs` | Keyword arguments |
195+
| Spec | Ruby Type | C Type(s) | Notes |
196+
| ---- | ------------- | --------------------------- | -------------------------------- |
197+
| `o` | any | `mrb_value` | No type check |
198+
| `i` | Numeric | `mrb_int` | Coerces to integer |
199+
| `f` | Numeric | `mrb_float` | Coerces to float |
200+
| `b` | any | `mrb_bool` | Truthiness |
201+
| `n` | String/Symbol | `mrb_sym` | Converts to symbol |
202+
| `s` | String | `const char*, mrb_int` | Pointer + length |
203+
| `z` | String | `const char*` | Null-terminated |
204+
| `S` | String | `mrb_value` | String value |
205+
| `A` | Array | `mrb_value` | Array value |
206+
| `H` | Hash | `mrb_value` | Hash value |
207+
| `C` | Class | `mrb_value` | Class/Module value |
208+
| `c` | Class | `struct RClass*` | Class pointer |
209+
| `a` | Array | `const mrb_value*, mrb_int` | Array pointer + length |
210+
| `d` | C Data | `void*` | Requires `mrb_data_type*` |
211+
| `&` | Block | `mrb_value` | Block argument |
212+
| `*` | rest | `const mrb_value*, mrb_int` | Rest arguments |
213+
| `\|` | — | — | Following args are optional |
214+
| `?` | — | `mrb_bool` | Was previous optional arg given? |
215+
| `:` | keywords | `mrb_kwargs` | Keyword arguments |
216216
217217
Adding `!` to `S`, `A`, `H`, `C`, `c`, `s`, `z`, `a`, `d` allows `nil`
218218
(returns NULL/zero for nil).
@@ -608,14 +608,14 @@ my_yield_method(mrb_state *mrb, mrb_value self)
608608

609609
### Fiber States
610610

611-
| State | Meaning |
612-
| ----- | ------- |
613-
| `MRB_FIBER_CREATED` | Created but not yet resumed |
614-
| `MRB_FIBER_RUNNING` | Currently executing |
615-
| `MRB_FIBER_RESUMED` | Resumed another fiber |
616-
| `MRB_FIBER_SUSPENDED` | Yielded, waiting to resume |
611+
| State | Meaning |
612+
| ----------------------- | -------------------------------- |
613+
| `MRB_FIBER_CREATED` | Created but not yet resumed |
614+
| `MRB_FIBER_RUNNING` | Currently executing |
615+
| `MRB_FIBER_RESUMED` | Resumed another fiber |
616+
| `MRB_FIBER_SUSPENDED` | Yielded, waiting to resume |
617617
| `MRB_FIBER_TRANSFERRED` | Transferred via `Fiber#transfer` |
618-
| `MRB_FIBER_TERMINATED` | Finished execution |
618+
| `MRB_FIBER_TERMINATED` | Finished execution |
619619

620620
**Limitation:** fibers cannot yield across C function boundaries.
621621
You cannot call `mrb_fiber_yield` from within a C-implemented
@@ -644,13 +644,13 @@ mrb_ccontext_free(mrb, cxt);
644644
645645
The `mrb_ccontext` structure provides several flags:
646646
647-
| Field | Purpose |
648-
| ----- | ------- |
647+
| Field | Purpose |
648+
| ---------------- | --------------------------------------- |
649649
| `capture_errors` | Collect parse errors instead of raising |
650-
| `no_exec` | Compile without executing (get RProc) |
651-
| `no_optimize` | Disable peephole optimizations |
652-
| `no_ext_ops` | Disable extended operand instructions |
653-
| `keep_lv` | Preserve local variables across loads |
650+
| `no_exec` | Compile without executing (get RProc) |
651+
| `no_optimize` | Disable peephole optimizations |
652+
| `no_ext_ops` | Disable extended operand instructions |
653+
| `keep_lv` | Preserve local variables across loads |
654654
655655
### Loading with Context
656656
@@ -843,14 +843,14 @@ $ build/host/bin/mruby-config --libs # libraries
843843

844844
Key macros that affect ABI:
845845

846-
| Macro | Effect |
847-
| ----- | ------ |
848-
| `MRB_NO_BOXING` | Struct-based values (larger, debuggable) |
849-
| `MRB_WORD_BOXING` | Single-word values (fast, 32-bit safe) |
850-
| `MRB_NAN_BOXING` | NaN-tagged values (default on 32-bit) |
851-
| `MRB_NO_FLOAT` | Disable Float support |
852-
| `MRB_INT64` | 64-bit integers |
853-
| `MRB_USE_FLOAT32` | 32-bit floats |
846+
| Macro | Effect |
847+
| ----------------- | ---------------------------------------- |
848+
| `MRB_NO_BOXING` | Struct-based values (larger, debuggable) |
849+
| `MRB_WORD_BOXING` | Single-word values (fast, 32-bit safe) |
850+
| `MRB_NAN_BOXING` | NaN-tagged values (default on 32-bit) |
851+
| `MRB_NO_FLOAT` | Disable Float support |
852+
| `MRB_INT64` | 64-bit integers |
853+
| `MRB_USE_FLOAT32` | 32-bit floats |
854854

855855
Mismatching these between library and application causes silent
856856
data corruption.

0 commit comments

Comments
 (0)