flake8-drf
Flake8 plugin that detects some issues with your drf code. Work in progress. Currently detects places where you should use drf status constants.
Installation
pip install flake8-drf
Usage
Let's say we have the following code below:
from rest_framework import views
from rest_framework.views import Response, APIView
class AuthView(APIView):
def get(self, request):
return Response(status=200)
class PostsView(views.APIView, APIView):
def post(self, request):
return Response(status=201)
Running flake8 with the plugin will tell the following:
main.py:8:25: DRF0 Status code can be changed to constant: HTTP_200_OK
main.py:14:25: DRF0 Status code can be changed to constant: HTTP_201_CREATED
Metadata
Release files for flake8-drf 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| flake8-drf-0.1.0.tar.gz | 2.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| flake8_drf-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.4 kB
Release files / flake8-drf-0.1.0.tar.gz
| Download URL | flake8-drf-0.1.0.tar.gz |
|---|---|
| Size | 2.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4ee75f80bb654e12a4510d652acdca0fc8b2399e1ea7c81bd0bd7b1629519098
|
|
BLAKE2b-256 checksum How to use checksums |
5daa108de5537bdea79542d9dc4f6c8f3473b603d7d00d5fc3f850883b5e41d1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.2.0 CPython/3.7.6 Darwin/21.3.0
|
Release files / flake8_drf-0.1.0-py3-none-any.whl
| Download URL | flake8_drf-0.1.0-py3-none-any.whl |
|---|---|
| Size | 3.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cea18c898b5aad470b56685f78a4e5eb3b476086600179e7ed5ab8f8bd1f8952
|
|
BLAKE2b-256 checksum How to use checksums |
ae2aaefa5d579f75ef0724489b641d9b1437507346257d622e29ebb6e8029bc3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.2.0 CPython/3.7.6 Darwin/21.3.0
|
Security for flake8-drf 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.