Skip to content

Commit 9ae40b0

Browse files
committed
Improved documentation
1 parent be9194b commit 9ae40b0

3 files changed

Lines changed: 61 additions & 0 deletions

File tree

CONTRIBUTING.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Contributing
2+
3+
If you would like to contribute, below you can find some helpful suggestions and instructions.
4+
5+
## Preparing the development environment
6+
7+
To install packages required for running tests and linting, run the following command:
8+
9+
```bash
10+
pip install -U -r requirements.txt
11+
```
12+
13+
## Running tests
14+
15+
If you wish to run the majority of the tests whilst skipping the slow integration tests on large third-party rulesets, use the following command:
16+
17+
```bash
18+
pytest
19+
```
20+
21+
To run the slower integration tests at the end of your development cycle, use the following command instead:
22+
23+
```bash
24+
pytest -m "slow" -k "not train"
25+
```
26+
27+
## Linting
28+
29+
To automatically fix some linting issues and check for remaining issues, run the following commands:
30+
31+
```bash
32+
black .
33+
ruff check . --fix
34+
pyright
35+
```
36+
37+
## Docs
38+
39+
To automatically generate the documentation from the code, run the following commands:
40+
41+
```bash
42+
./docs/make.bat clean
43+
./docs/make.bat html
44+
```
45+
46+
To locally view the docs, run the following command:
47+
48+
```bash
49+
python -m http.server -b localhost -d docs/_build/html 8000
50+
```
51+
52+
and inspect the docs at `localhost:8000`

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@
99
[`suricata-check`](https://github.com/Koen1999/suricata-check) is a command line utility to provide feedback on [Suricata](https://github.com/OISF/suricata) rules.
1010
The tool can detect various issues including those covering syntax validity, interpretability, rule specificity, rule coverage, and efficiency.
1111

12+
## How to use this template
13+
14+
1. Choose a name for your extension (e.g. `suricata-check-foobar`) and replace `suricata-check-extension-example` by your chosen name in all folder names, file names, and file contents. Similarly, replace `suricata_check_extension_example` by your chosen name with the dashes (`-`) substituted by underscores (`_`).
15+
2. Rename `suricata_check_extension-example/checkers/example.py` and the class contained therein and make refactor accordingly in that file, and in `suricata_check_extension-example/checkers/init.py`.
16+
3. Similarly, rename `tests/checkers/test_example.py` and adjust the reference to the renamed checker file/class in that file and in `tests/test_suricata_check.py`.
17+
4. Implement tests for your checker in `tests/checkers/test_example.py` and implement the checker in `suricata_check_extension-example/checkers/example.py`.
18+
5. You can now package, distribute and install the extension like any other Python package. When installed, the extension will be automatically selected by `suricata-check` when ran from the command line.
19+
1220
## Contributing
1321

1422
If you would like to contribute, please check out [CONTRIBUTING.md](https://github.com/Koen1999/suricata-check-extension-example/blob/master/CONTRIBUTING.md) some helpful suggestions and instructions.

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ classifiers = [
4444
"Programming Language :: Python :: 3.10",
4545
"Programming Language :: Python :: 3.11",
4646
"Programming Language :: Python :: 3.12",
47+
"Programming Language :: Python :: 3.13",
4748
"Programming Language :: Python :: 3 :: Only",
4849
"Operating System :: OS Independent",
4950
"Operating System :: POSIX",

0 commit comments

Comments
 (0)