Skip to content

Commit b076d94

Browse files
Revised documentation for contributing and building from source.
1 parent 578d900 commit b076d94

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎docs/CONTRIBUTING.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,13 @@ Often times you will need to create functions to condense redundant tasks. You c
366366

367367
`$some_variable = APITools\your_custom_tool_function();`
368368

369+
As a general rule, functions should be kept within the API model they relate closest to. For example, a function that
370+
checks for the existence of an alias by name should be kept in the APIFirewallAlias* models, even if multiple models
371+
will use the function. Tool functions should only be used in one of the following situations:
372+
- Multiple models, endpoints or tools use the function and the function does not directly relate to any of the existing
373+
API models, or it directly relates to multiple models.
374+
- Use of the function causes an `include` or `require` loop.
375+
369376

370377
## Writing API E2E Tests ##
371378
E2E tests are written using Python3. pfSense API includes a an e2e_test_framework module in the `tests` directory to make

0 commit comments

Comments
 (0)