Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests/ci #16

Merged
merged 31 commits into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/mypy_flake.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: flake8 Lint

on: [push, pull_request]

jobs:
flake8-lint:
runs-on: ubuntu-latest
name: Проверка flake8
steps:
- name: Check out source repository
uses: actions/checkout@v3
- name: Set up Python environment
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: flake8 Lint
uses: py-actions/flake8@v2

run_mypy:
runs-on: ubuntu-latest
name: Mypy
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Run Mypy
uses: jashparekh/mypy-action@v2
with:
requirements: django-stubs django
14 changes: 4 additions & 10 deletions adaptive_hockey_federation/adaptive_hockey_federation/asgi.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
"""
ASGI config for adaptive_hockey_federation project.

It exposes the ASGI callable as a module-level variable named ``application``.

For more information on this file, see
https://docs.djangoproject.com/en/4.2/howto/deployment/asgi/
"""

import os

from django.core.asgi import get_asgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'adaptive_hockey_federation.settings')
os.environ.setdefault(
'DJANGO_SETTINGS_MODULE',
'adaptive_hockey_federation.settings'
)

application = get_asgi_application()
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = []
ALLOWED_HOSTS: list = []


# Application definition
Expand Down
14 changes: 4 additions & 10 deletions adaptive_hockey_federation/adaptive_hockey_federation/wsgi.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
"""
WSGI config for adaptive_hockey_federation project.

It exposes the WSGI callable as a module-level variable named ``application``.

For more information on this file, see
https://docs.djangoproject.com/en/4.2/howto/deployment/wsgi/
"""

import os

from django.core.wsgi import get_wsgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'adaptive_hockey_federation.settings')
os.environ.setdefault(
'DJANGO_SETTINGS_MODULE',
'adaptive_hockey_federation.settings'
)

application = get_wsgi_application()
2 changes: 1 addition & 1 deletion adaptive_hockey_federation/main/admin.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from django.contrib import admin
from django.contrib import admin # noqa

# Register your models here.
2 changes: 1 addition & 1 deletion adaptive_hockey_federation/main/models.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from django.db import models
from django.db import models # noqa

# Create your models here.
3 changes: 2 additions & 1 deletion adaptive_hockey_federation/manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'adaptive_hockey_federation.settings')
os.environ.setdefault('DJANGO_SETTINGS_MODULE',
'adaptive_hockey_federation.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
Expand Down
2 changes: 1 addition & 1 deletion adaptive_hockey_federation/users/admin.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from django.contrib import admin
from django.contrib import admin # noqa

# Register your models here.
2 changes: 1 addition & 1 deletion adaptive_hockey_federation/users/models.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from django.db import models
from django.db import models # noqa

# Create your models here.
2 changes: 1 addition & 1 deletion adaptive_hockey_federation/users/views.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from django.shortcuts import render
from django.shortcuts import render # noqa

# Create your views here.
123 changes: 91 additions & 32 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ flake8 = "^6.1.0"
flake8-isort = "^6.1.0"
mypy = "^1.5.1"
flake8-django = "^1.4"
django-stubs = "^4.2.4"


[tool.isort]
Expand All @@ -27,3 +28,11 @@ include_trailing_comma = true
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"


[tool.mypy]
plugins = ["mypy_django_plugin.main"]
mypy_path = ./adaptive_hockey_federation

[tool.django-stubs]
django_settings_module = "adaptive_hockey_federation.settings"
12 changes: 12 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[flake8]
ignore =
W503,
F811
exclude =
tests/,
*/migrations/,
venv/,
env/
per-file-ignores =
*/settings.py:E501
max-complexity = 10
Loading