Skip to content

Commit 0823d13

Browse files
authored
Merge pull request #43 from opbot-xd/update-greedybear-docs-ruff-migration
docs(GreedyBear): Update for Ruff migration and expand API documentation
2 parents ff446af + 75cfd12 commit 0823d13

2 files changed

Lines changed: 57 additions & 2 deletions

File tree

docs/GreedyBear/Api-docs.md

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# API Documentation
22

3+
## API Endpoints
4+
35
### `Enrichment`
46
:::docs.Submodules.GreedyBear.api.views.enrichment.enrichment_view
57

@@ -12,13 +14,44 @@
1214
### `Feeds Pagination`
1315
:::docs.Submodules.GreedyBear.api.views.feeds.feeds_pagination
1416

17+
### `Cowrie Session`
18+
:::docs.Submodules.GreedyBear.api.views.cowrie_session.cowrie_session_view
19+
1520
### `Command Sequence`
1621
:::docs.Submodules.GreedyBear.api.views.command_sequence.command_sequence_view
1722

18-
### `general_honeypot_list`
23+
### `General Honeypot List`
1924
:::docs.Submodules.GreedyBear.api.views.general_honeypot.general_honeypot_list
2025

2126
### `Statistics`
2227
:::docs.Submodules.GreedyBear.api.views.statistics.StatisticsViewSet
2328

29+
## Serializers
30+
31+
### `EnrichmentSerializer`
32+
:::docs.Submodules.GreedyBear.api.serializers.EnrichmentSerializer
33+
34+
### `FeedsRequestSerializer`
35+
:::docs.Submodules.GreedyBear.api.serializers.FeedsRequestSerializer
36+
37+
_Note: Enhanced with additional filter fields (ioc_type, etc.) in version > 2.4.0_
38+
39+
### `FeedsResponseSerializer`
40+
:::docs.Submodules.GreedyBear.api.serializers.FeedsResponseSerializer
41+
42+
### `IOCSerializer`
43+
:::docs.Submodules.GreedyBear.api.serializers.IOCSerializer
44+
45+
_Note: Includes FireHol categories field in version > 2.4.0_
46+
47+
### `GeneralHoneypotSerializer`
48+
:::docs.Submodules.GreedyBear.api.serializers.GeneralHoneypotSerializer
49+
50+
## Validation Functions
51+
52+
### `feed_type_validation`
53+
:::docs.Submodules.GreedyBear.api.serializers.feed_type_validation
54+
55+
### `ordering_validation`
56+
:::docs.Submodules.GreedyBear.api.serializers.ordering_validation
2457

docs/GreedyBear/Contribute.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,17 @@ For this reason it is important to follow some easy rules based on a simple but
2222

2323
## Code Style
2424

25-
Keeping to a consistent code style throughout the project makes it easier to contribute and collaborate. We make use of [`psf/black`](https://github.com/psf/black) and [isort](https://pycqa.github.io/isort/) for code formatting and [`flake8`](https://flake8.pycqa.org) for style guides.
25+
Keeping to a consistent code style throughout the project makes it easier to contribute and collaborate. We use [Ruff](https://docs.astral.sh/ruff/) as our all-in-one linter and formatter, which provides:
26+
27+
- **Code Formatting**: Replaces `black` with fast, compatible formatting
28+
- **Import Sorting**: Replaces `isort` with automatic import organization
29+
- **Linting**: Replaces `flake8` with 100+ rule sets including:
30+
- pycodestyle (E/W) - PEP 8 style enforcement
31+
- pep8-naming (N) - Naming convention checks
32+
- pyupgrade (UP) - Modern Python syntax suggestions
33+
- flake8-bugbear (B) - Common bug detection
34+
- flake8-comprehensions (C4) - List/dict comprehension improvements
35+
- flake8-django (DJ) - Django-specific best practices
2636

2737
## How to start (Setup project and development instance)
2838

@@ -43,6 +53,18 @@ pip install pre-commit
4353
pre-commit install -c .github/.pre-commit-config.yaml
4454
```
4555

56+
Once configured, Ruff will automatically run on every commit. If you want to manually run Ruff before committing, you can use:
57+
58+
```bash
59+
# Format and fix auto-fixable issues
60+
pre-commit run ruff --all-files
61+
62+
# Or run Ruff directly (requires: pip install ruff)
63+
ruff check . # Check for linting issues
64+
ruff check . --fix # Auto-fix issues
65+
ruff format . # Format code
66+
```
67+
4668
Remember that whenever you make changes, you need to rebuild the docker image to see the reflected changes.
4769

4870
```bash

0 commit comments

Comments
 (0)