From 296e8f4fa724181ad3e3b607a852c3b6d3e18386 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Thu, 10 Oct 2024 17:07:18 -0400 Subject: [PATCH] Move ignores to ruff.toml --- .github/workflows/ci.yml | 2 +- docs/development/style-guide.md | 2 +- ruff.toml | 2 ++ scripts/git-hooks/pre-commit | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 ruff.toml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1b1793139..c3b4876c3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -85,7 +85,7 @@ jobs: run: python netbox/manage.py makemigrations --check - name: Check PEP8 compliance - run: ruff check netbox/ --ignore E501,F403,F405 + run: ruff check netbox/ - name: Check UI ESLint, TypeScript, and Prettier Compliance run: yarn --cwd netbox/project-static validate diff --git a/docs/development/style-guide.md b/docs/development/style-guide.md index a41fee075..0d4caf395 100644 --- a/docs/development/style-guide.md +++ b/docs/development/style-guide.md @@ -25,7 +25,7 @@ NetBox generally follows the [Django style guide](https://docs.djangoproject.com The [ruff](https://docs.astral.sh/ruff/) linter is used to enforce code style. A [pre-commit hook](./getting-started.md#3-enable-pre-commit-hooks) which runs this automatically is included with NetBox. To invoke `ruff` manually, run: ``` -ruff check netbox/ --ignore E501,F403,F405 +ruff check netbox/ ``` #### Linter Exceptions diff --git a/ruff.toml b/ruff.toml new file mode 100644 index 000000000..854404469 --- /dev/null +++ b/ruff.toml @@ -0,0 +1,2 @@ +[lint] +ignore = ["E501", "F403", "F405"] diff --git a/scripts/git-hooks/pre-commit b/scripts/git-hooks/pre-commit index c7d968f0a..4b4ca172f 100755 --- a/scripts/git-hooks/pre-commit +++ b/scripts/git-hooks/pre-commit @@ -29,7 +29,7 @@ if [ ${NOVALIDATE} ]; then fi echo "Linting with ruff..." -ruff check netbox/ --ignore E501,F403,F405 +ruff check netbox/ if [ $? != 0 ]; then EXIT=1 fi