Skip to content

Commit d4d0aaf

Browse files
authored
Add ruff linter and formatter to pre-commit (#856)
* Add ruff linter to pre-commit * add ruff formater too * ruff format all files * formatting
1 parent e99ea81 commit d4d0aaf

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

.pre-commit-config.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@ repos:
33
rev: 'v4.5.0'
44
hooks:
55
- id: check-merge-conflict
6+
- repo: https://github.com/astral-sh/ruff-pre-commit
7+
rev: v0.9.1
8+
hooks:
9+
- id: ruff
10+
types_or: [ python, pyi ]
11+
args: [--select, I, --fix,]
12+
files: "^tests/|^rest_framework_simplejwt/"
13+
- id: ruff-format
14+
types_or: [python, pyi]
15+
files: "^tests/|^rest_framework_simplejwt/"
616
- repo: https://github.com/asottile/yesqa
717
rev: v1.5.0
818
hooks:
919
- id: yesqa
10-
- repo: https://github.com/pycqa/isort
11-
rev: '5.12.0'
12-
hooks:
13-
- id: isort
14-
args: ["--profile", "black"]
15-
- repo: https://github.com/psf/black
16-
rev: '23.11.0'
17-
hooks:
18-
- id: black
19-
language_version: python3 # Should be a command that runs python3.6+
2020
- repo: https://github.com/pre-commit/pre-commit-hooks
2121
rev: 'v4.5.0'
2222
hooks:

setup.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@
1414
"tox",
1515
],
1616
"lint": [
17-
"flake8",
18-
"pep8",
19-
"isort",
17+
"ruff",
18+
"yesqa",
19+
"pyupgrade",
20+
"pre-commit",
2021
],
2122
"doc": [
2223
"Sphinx>=1.6.5,<2",

tests/test_backends.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@
99
import jwt
1010
import pytest
1111
from django.test import TestCase
12-
from jwt import PyJWS
12+
from jwt import PyJWS, algorithms
1313
from jwt import __version__ as jwt_version
14-
from jwt import algorithms
1514

1615
from rest_framework_simplejwt.backends import JWK_CLIENT_AVAILABLE, TokenBackend
1716
from rest_framework_simplejwt.exceptions import (

0 commit comments

Comments
 (0)