Skip to content
This repository was archived by the owner on Oct 13, 2025. It is now read-only.

Commit c78d4a2

Browse files
committed
Merge remote-tracking branch 'origin/topic/timw/rst-linting'
* origin/topic/timw/rst-linting: Regenerate spicy docs Regenerate docs for rst linting fixes from scripts and bifs Fix uses of backticks Add pre-commit for linting rst, fix colon issues Use :file: directive for all log files in non-generated code
2 parents 0fd963f + b36015c commit c78d4a2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+223
-212
lines changed

.pre-commit-config.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,11 @@ repos:
77
- id: ruff-format
88
- id: ruff
99
args: [--fix]
10+
11+
- repo: https://github.com/pre-commit/pygrep-hooks
12+
rev: v1.10.0
13+
hooks:
14+
- id: rst-directive-colons
15+
stages: ["pre-commit"]
16+
- id: rst-backticks
17+
stages: ["pre-commit"]

cluster-setup.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ Offloading and ethtool tuning
177177
While not specific to AF_PACKET, it is recommended to disable any offloading
178178
features provided by the network card or Linux networking stack when running
179179
Zeek. This allows to see network packets as they arrive on the wire.
180-
See this `blog post <https://blog.securityonion.net/2011/10/when-is-full-packet-capture-not-full.html`>_
180+
See this `blog post <https://blog.securityonion.net/2011/10/when-is-full-packet-capture-not-full.html>`_
181181
for more background
182182

183183
Toggling these features can be done with the ``ethtool -K`` command, for example::
@@ -600,4 +600,3 @@ same packets multiple times with different tools.
600600
601601
This issue has been fixed in all stable kernels for at least 5 years.
602602
You're unlikely to be affected.
603-

customizations.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,14 +286,14 @@ package helps you with that.
286286
Long Connections
287287
----------------
288288

289-
Zeek logs connection entries into the ``conn.log`` only upon termination
289+
Zeek logs connection entries into the :file:`conn.log` only upon termination
290290
or due to expiration of inactivity timeouts. Depending on the protocol and
291291
chosen timeout values this can significantly delay the appearance of a log
292292
entry for a given connection. The delay may be up to an hour for lingering
293293
SSH connections or connections where the final FIN or RST packets were missed.
294294

295-
The `zeek-long-connections`_ package alleviates this by creating a ``conn_long.log``
296-
log with the same format as ``conn.log``, but containing entries for connections
295+
The `zeek-long-connections`_ package alleviates this by creating a :file:`conn_long.log`
296+
log with the same format as :file:`conn.log`, but containing entries for connections
297297
that have been existing for configurable intervals.
298298
By default, the first entry for a connection is logged after 10mins. Depending on
299299
the environment, this can be lowered as even a 10 minute delay may be significant

devel/plugins.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ If your plugin isn't loading as expected, Zeek's debugging facilities
449449
can help illuminate what's going on. To enable, recompile Zeek
450450
with debugging support (``./configure --enable-debug``), and
451451
afterwards rebuild your plugin as well. If you then run Zeek with ``-B
452-
plugins``, it will produce a file ``debug.log`` that records details
452+
plugins``, it will produce a file :file:`debug.log` that records details
453453
about the process for searching, loading, and activating plugins.
454454

455455
To generate your own debugging output from inside your plugin, you can
@@ -463,7 +463,7 @@ your plugin's debugging output with ``-B plugin-<name>``, where
463463
``Configure()`` method, yet with the namespace-separator ``::``
464464
replaced with a simple dash. Example: If the plugin is called
465465
``Demo::Rot13``, use ``-B plugin-Demo-Rot13``. As usual, the debugging
466-
output will be recorded to ``debug.log`` if Zeek's compiled in debug
466+
output will be recorded to :file:`debug.log` if Zeek's compiled in debug
467467
mode.
468468

469469
Building Plugins Statically

devel/spicy/autogen/init-bare.zeek

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export {
2323
# doc-options-end
2424

2525
# doc-types-start
26-
## Result type for `Spicy::resource_usage()`. The values reflect resource
26+
## Result type for ``Spicy::resource_usage()``. The values reflect resource
2727
## usage as reported by the Spicy runtime system.
2828
type ResourceUsage: record {
2929
user_time : interval; ##< user CPU time of the Zeek process

devel/spicy/reference.rst

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ File analyzers support the following properties:
305305
"content sniffing" (i.e., similar to libmagic), and
306306
usually not by protocol-level headers (e.g., *not* through
307307
HTTP's ``Content-Type`` header). If in doubt, examine
308-
``files.log`` for what it records as a file's type.
308+
:file:`files.log` for what it records as a file's type.
309309

310310
``replaces ANALYZER_NAME``
311311
Disables an existing file analyzer that Zeek already provides
@@ -942,7 +942,7 @@ membership in a ``set`` like this:
942942

943943
.. code-block:: zeek
944944
945-
# Zeek module `MyModule`
945+
# Zeek module MyModule
946946
option my_set: set[count] = { 1, 2, 3 };
947947
948948
.. code-block:: spicy
@@ -958,7 +958,7 @@ functions for conversion. Example accessing a record's field:
958958

959959
.. code-block:: zeek
960960
961-
# Zeek module `MyModule`
961+
# Zeek module MyModule
962962
option my_record: record {
963963
a: count &default = 42;
964964
b: string &default = "foo";
@@ -1103,7 +1103,7 @@ see what it's doing at runtime. You'll need a debug version of Zeek
11031103
for that, as well as a small trace with traffic that you expect your
11041104
analyzer to process. Run Zeek with ``-B dpd`` (or ``-B file_analysis``
11051105
if you're debugging a file analyzer) on your trace to record the
1106-
analyzer activity into ``debug.log``. For example, with the same HTTP
1106+
analyzer activity into :file:`debug.log`. For example, with the same HTTP
11071107
example, we get:
11081108

11091109
.. code-block:: text
@@ -1189,4 +1189,3 @@ their full Zeek-side values::
11891189
[2] uri: string = /index.html
11901190
[3] version: string = 1.0
11911191
[...]
1192-

devel/spicy/tutorial.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ the corresponding value of ``is_read``. Let's try it with a new
208208
# zeek -r tftp_rrq.pcap tftp.hlto tftp.zeek
209209
TFTP read request, [orig_h=192.168.0.253, orig_p=50618/udp, resp_h=192.168.0.10, resp_p=69/udp], T, rfc1350.txt, octet
210210
211-
If we look at the ``conn.log`` that Zeek produces during this run, we
211+
If we look at the :file:`conn.log` that Zeek produces during this run, we
212212
will see that the ``service`` field is not filled in yet. That's
213213
because our analyzer does not yet confirm to Zeek that it has been
214214
successful in parsing the content. To do that, we can call a library
@@ -333,7 +333,7 @@ analyzers' events, and collect and correlate their activity as
333333
desired. We have created such :download:`a script for TFTP
334334
<autogen/tftp.zeek>`, based on the events that our Spicy analyzer
335335
generates. Once we add that to the Zeek command line, we will see a
336-
new ``tftp.log``:
336+
new :file:`tftp.log`:
337337

338338
.. code::
339339
@@ -346,7 +346,7 @@ new ``tftp.log``:
346346
The TFTP script also labels the second session as TFTP data by
347347
adding a corresponding entry to the ``service`` field inside the
348348
Zeek-side connection record. With that, we are now seeing this in
349-
``conn.log``:
349+
:file:`conn.log`:
350350

351351
.. code::
352352

ext/spicy-pygments.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2020-2023 by the Zeek Project. See LICENSE for details.
1+
# Copyright (c) 2020-now by the Zeek Project. See LICENSE for details.
22

33
from pygments.lexer import RegexLexer, bygroups, include, words
44
from pygments.token import (

frameworks/file-analysis.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,12 @@ File Type Identification
8484
Zeek ships with its own library of content signatures to determine the type of a
8585
file, conveyed as MIME types in the :zeek:see:`file_sniff` event. You can find
8686
those signatures in the Zeek distribution's ``scripts/base/frameworks/files/magic/``
87-
directory. (Despite the name, Zeek does `not` rely on libmagic for content analysis.)
87+
directory. (Despite the name, Zeek does *not* rely on libmagic for content analysis.)
8888

8989
Adding Analysis
9090
===============
9191

92-
Zeek supports customized file analysis via `file analyzers` that users can
92+
Zeek supports customized file analysis via *file analyzers* that users can
9393
attach to observed files. You can attach analyzers selectively to individual
9494
files, or register them for auto-attachment under certain conditions. Once
9595
attached, file analyzers start receiving the contents of files as Zeek parses
@@ -139,7 +139,7 @@ for additional APIs and data structures.
139139

140140
Regardless of which file analyzers end up acting on a file, general
141141
information about the file (e.g. size, time of last data transferred,
142-
MIME type, etc.) is logged in ``files.log``.
142+
MIME type, etc.) is logged in :file:`files.log`.
143143

144144
Protocol-specific state
145145
-----------------------
@@ -207,8 +207,8 @@ customized analysis. Since observed files can be very large, Zeek cannot buffer
207207
these files and provide their entire content to the script layer once
208208
complete. Instead, the ``FileDataEvent`` analyzer reflects the incremental
209209
nature of file content as Zeek observes it, and supports two types of events to
210-
allow you to process it: user-provided `stream events` receive new file content
211-
as supplied by connection-oriented protocols, while `chunk events` receive
210+
allow you to process it: user-provided *stream events* receive new file content
211+
as supplied by connection-oriented protocols, while *chunk events* receive
212212
observed data as provided by protocols that do not feature stream semantics.
213213

214214
The following example manually computes the SHA256 hash of each observed file by

frameworks/input.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ Broken input data
318318
-----------------
319319

320320
The input framework notifies you of problems during data ingestion in two ways.
321-
First, reporter messages, ending up in reporter.log, indicate the type of
321+
First, reporter messages, ending up in :file:`reporter.log`, indicate the type of
322322
problem and the file in which the problem occurred::
323323

324324
#fields ts level message location

0 commit comments

Comments
 (0)