mirror of
https://github.com/RoboSats/robosats.git
synced 2024-12-13 19:06:26 +00:00
Python files style cleanup (#281)
* Remove unused imports in python files * Add black and isort dependencies Also added pyproject.toml for isort config, but later can be used to configure various other python tools * Add flake8 in requirements.txt * Add py-linter workflow
This commit is contained in:
parent
437145225e
commit
c32c07eaa6
32
.github/workflows/py-linter.yml
vendored
Normal file
32
.github/workflows/py-linter.yml
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
name: Python Lint
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- '**.py'
|
||||
|
||||
jobs:
|
||||
run-linters:
|
||||
name: Run linters
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.10'
|
||||
cache: pip
|
||||
- run: pip install black==22.8.0 flake8==5.0.4 isort==5.10.1
|
||||
- name: Run linters
|
||||
uses: wearerequired/lint-action@v2
|
||||
with:
|
||||
auto_fix: true
|
||||
black: true
|
||||
flake8: true
|
||||
# Flake8 doesn't support auto-fixing
|
||||
flake8_auto_fix: false
|
@ -2,7 +2,6 @@ from decouple import config
|
||||
from secrets import token_urlsafe
|
||||
from api.models import Order
|
||||
from api.utils import get_session
|
||||
import time
|
||||
|
||||
class Telegram():
|
||||
''' Simple telegram messages by requesting to API'''
|
||||
|
@ -1,4 +1,3 @@
|
||||
from django.template.defaultfilters import default
|
||||
from rest_framework import serializers
|
||||
from .models import MarketTick, Order
|
||||
from decouple import config
|
||||
|
@ -1,6 +1,6 @@
|
||||
from django.urls import path
|
||||
from .views import MakerView, OrderView, UserView, BookView, InfoView, RewardView, PriceView, LimitView, HistoricalView, TickView, StealthView
|
||||
from drf_spectacular.views import SpectacularAPIView, SpectacularRedocView, SpectacularSwaggerView
|
||||
from drf_spectacular.views import SpectacularAPIView, SpectacularRedocView
|
||||
from chat.views import ChatView
|
||||
|
||||
urlpatterns = [
|
||||
|
@ -1,10 +1,6 @@
|
||||
import os
|
||||
from re import T
|
||||
from django.db.models import Sum, Q
|
||||
from drf_spectacular.types import OpenApiTypes
|
||||
from drf_spectacular.utils import OpenApiExample, OpenApiParameter, extend_schema
|
||||
from drf_spectacular.utils import extend_schema
|
||||
from rest_framework import status, viewsets
|
||||
from rest_framework.exceptions import bad_request
|
||||
from rest_framework.generics import CreateAPIView, ListAPIView, UpdateAPIView
|
||||
from rest_framework.views import APIView
|
||||
from rest_framework.response import Response
|
||||
|
2
pyproject.toml
Normal file
2
pyproject.toml
Normal file
@ -0,0 +1,2 @@
|
||||
[tool.isort]
|
||||
profile = "black"
|
@ -29,3 +29,7 @@ python-gnupg==0.4.9
|
||||
daphne==3.0.2
|
||||
drf-spectacular==0.24.0
|
||||
drf-spectacular-sidecar==2022.9.1
|
||||
black==22.8.0
|
||||
isort==5.10.1
|
||||
flake8==5.0.4
|
||||
pyflakes==2.5.0
|
||||
|
Loading…
Reference in New Issue
Block a user