Skip to content

Commit 1cb5a52

Browse files
committed
Add ruff config (ruff.toml, dev dep) and document in CLAUDE.md
1 parent 08d82b5 commit 1cb5a52

4 files changed

Lines changed: 26 additions & 2 deletions

File tree

CLAUDE.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,24 @@
44

55
- **Never** add `Co-Authored-By: Claude` (or any Claude/Anthropic credit) to commit messages.
66

7+
## Linting & Formatting
8+
9+
[ruff](https://docs.astral.sh/ruff/) is the project linter and formatter.
10+
Configuration lives in `ruff.toml` (line-length = 120, ruleset E/F/W/I).
11+
12+
```bash
13+
# Install dev dependencies (includes ruff)
14+
pip install -e ".[dev]"
15+
16+
# Check
17+
ruff check netbox_custom_objects_tab/
18+
19+
# Format
20+
ruff format netbox_custom_objects_tab/
21+
```
22+
23+
Always run both before committing Python changes.
24+
725
## Purpose
826

927
Adds a **"Custom Objects"** tab to NetBox object detail pages (Device, Site, Rack, etc.),

netbox_custom_objects_tab/views.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
from django.shortcuts import get_object_or_404, render
1010
from django.utils.translation import gettext_lazy as _
1111
from django.views.generic import View
12-
1312
from extras.choices import CustomFieldTypeChoices
1413
from netbox.plugins import get_plugin_config
1514
from netbox.tables import BaseTable

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ classifiers = [
2525
dependencies = []
2626

2727
[project.optional-dependencies]
28-
dev = ["pytest", "pytest-django"]
28+
dev = ["pytest", "pytest-django", "ruff"]
2929

3030
[project.urls]
3131
Homepage = "https://github.com/CESNET/netbox-custom-objects-tab"

ruff.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
line-length = 120
2+
3+
[lint]
4+
select = ["E", "F", "W", "I"]
5+
6+
[lint.isort]
7+
known-third-party = ["extras", "netbox", "utilities", "netbox_custom_objects"]

0 commit comments

Comments
 (0)