Обсуждение Django
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Go down
avatar
Damir
Guest

Настроить flake8 под lms Empty Настроить flake8 под lms

Fri Feb 16, 2024 12:09 pm

Установите плагины

Список известных тут

Настройте flake

Создайте файл ".flake8" на самом верхнем уровне:
Code:
[flake8]
exclude = .git,__pycache__,.venv,venv,*/migrations/
import-order-style = google
application-import-names = about, catalog, core, download, feedback, homepage, lyceum, users

import-order-style
По умолчанию в проверке используется стиль cryptography, lms требует стиль google
Вот тут другие стили pypi.org/project/flake8-import-order/

application-import-names
Без этого возникает ошибка: I201 Missing newline between import groups. 'from lyceum import settings' is identified as Application and 'from django.urls import include, path' is identified as Third Party.
Так как flake не знает, какие модули не сторонние

Для двойных кавычек добавьте:
Code:
literal-inline-quotes = double
inline-quotes = double
Back to top
Permissions in this forum:
You cannot reply to topics in this forum