Skip to content

Commit 1eb36bb

Browse files
committed
docs: document the API for setting the maximum number of warnings for the compiler.
1 parent 67e5fe9 commit 1eb36bb

3 files changed

Lines changed: 36 additions & 2 deletions

File tree

site/content/docs/api/c.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,22 @@ the rest of rules that don't rely on that module will be correctly compiled.
327327

328328
------
329329

330+
#### yrx_compiler_max_warnings
331+
332+
{{< callout >}}
333+
New in version 1.16.0
334+
{{< /callout >}}
335+
336+
```c
337+
enum YRX_RESULT yrx_compiler_max_warnings(
338+
struct YRX_COMPILER *compiler,
339+
size_t n);
340+
```
341+
342+
Sets the maximum number of warnings. The compiler will report only the first `n` warnings.
343+
344+
------
345+
330346
#### yrx_compiler_ban_module
331347
332348
```c

site/content/docs/api/python.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,21 @@ compiler.define_global("my_int_var", 1)
211211
compiler.add_source("rule test { condition: my_int_var == 1 }")
212212
```
213213

214+
#### .max_warnings(n)
215+
216+
{{< callout >}}
217+
New in version 1.16.0
218+
{{< /callout >}}
219+
220+
Sets the maximum number of warnings. The compiler will report only the first `n` warnings.
221+
222+
##### Example
223+
224+
```python
225+
compiler = yara_x.Compiler()
226+
compiler.max_warnings(1)
227+
```
228+
214229
#### .enable_includes(bool)
215230

216231
Enables or disables the inclusion of files with the `include` directive. When includes

site/hugo_stats.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,7 @@
456456
"example-2",
457457
"example-20",
458458
"example-21",
459+
"example-22",
459460
"example-3",
460461
"example-4",
461462
"example-5",
@@ -557,9 +558,9 @@
557558
"logmessage-boolean",
558559
"logmessage-float",
559560
"logmessage-integer",
560-
"logmessage-offset-length-new-in-version-v1150",
561+
"logmessage-offset-length",
561562
"logmessage-string",
562-
"logoffset-length-new-in-version-v1150",
563+
"logoffset-length",
563564
"logstring",
564565
"machine",
565566
"mapitem",
@@ -569,6 +570,7 @@
569570
"match-lengths",
570571
"matches",
571572
"matching_rules",
573+
"max_warningsn",
572574
"maxint-int",
573575
"md5offset-size",
574576
"md5string",
@@ -736,6 +738,7 @@
736738
"yrx_compiler_destroy",
737739
"yrx_compiler_errors_json",
738740
"yrx_compiler_ignore_module",
741+
"yrx_compiler_max_warnings",
739742
"yrx_compiler_new_namespace",
740743
"yrx_compiler_warnings_json",
741744
"yrx_console_callback",

0 commit comments

Comments
 (0)