Skip to content

Commit

Permalink
Add ruff linter and formatter to pre-commit (#856)
Browse files Browse the repository at this point in the history
* Add ruff linter to pre-commit

* add ruff formater too

* ruff format all files

* formatting
  • Loading branch information
vgrozdanic authored Jan 13, 2025
1 parent e99ea81 commit d4d0aaf
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
20 changes: 10 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@ repos:
rev: 'v4.5.0'
hooks:
- id: check-merge-conflict
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.1
hooks:
- id: ruff
types_or: [ python, pyi ]
args: [--select, I, --fix,]
files: "^tests/|^rest_framework_simplejwt/"
- id: ruff-format
types_or: [python, pyi]
files: "^tests/|^rest_framework_simplejwt/"
- repo: https://github.com/asottile/yesqa
rev: v1.5.0
hooks:
- id: yesqa
- repo: https://github.com/pycqa/isort
rev: '5.12.0'
hooks:
- id: isort
args: ["--profile", "black"]
- repo: https://github.com/psf/black
rev: '23.11.0'
hooks:
- id: black
language_version: python3 # Should be a command that runs python3.6+
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: 'v4.5.0'
hooks:
Expand Down
7 changes: 4 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
"tox",
],
"lint": [
"flake8",
"pep8",
"isort",
"ruff",
"yesqa",
"pyupgrade",
"pre-commit",
],
"doc": [
"Sphinx>=1.6.5,<2",
Expand Down
3 changes: 1 addition & 2 deletions tests/test_backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@
import jwt
import pytest
from django.test import TestCase
from jwt import PyJWS
from jwt import PyJWS, algorithms
from jwt import __version__ as jwt_version
from jwt import algorithms

from rest_framework_simplejwt.backends import JWK_CLIENT_AVAILABLE, TokenBackend
from rest_framework_simplejwt.exceptions import (
Expand Down

0 comments on commit d4d0aaf

Please sign in to comment.