Skip to content

Commit

Permalink
check requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
Roman-Zhirovskis committed Jul 2, 2023
1 parent 6ef0f6f commit 1d2eedd
Show file tree
Hide file tree
Showing 157 changed files with 2,053 additions and 2,159 deletions.
18 changes: 12 additions & 6 deletions .github/workflows/users_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,22 @@ jobs:
steps:
- name: Checkout repository code
uses: actions/checkout@v3
- name: Install dependencies
run: pip install flake8
- name: Test with flake8
run: |
cd backend/users/backend && python -m flake8

- name: Install python
uses: actions/setup-python@v3

- run: pip install pre-commit
- run: pre-commit --version

- run: |
cd backend/users && pre-commit install
- run: |
cd backend/users && pre-commit run --all-files
- name: Run test in docker-compose
run: |
cd backend/users/ && docker-compose -f docker-compose.tests.yml \
up \
--build \
--abort-on-container-exit \
--exit-code-from web_users_tests
24 changes: 20 additions & 4 deletions backend/users/.flake8
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
[flake8]
ignore = E203, E231, E266, E501, W503, F403, F401
max-line-length = 88
max-complexity = 18
select = B,C,E,F,W,T4,B9
max-line-length = 100
extend-ignore =
# assignment lambda to variable - okay
E731,
# unnecessary variable assignment before return statement.
R504,
# too many leading '#' for block comment
E266,
# imported but unused
F401,
# Remove bad quotes
Q000,
# class attribute "attribute" is shadowing a python builtin
A003,
B006,

exclude =
venv
**migrations**
__init__.py

36 changes: 31 additions & 5 deletions backend/users/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,41 @@
files: 'backend/users*'
name: CI/CD for payments
repos:
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.74.1
hooks:
- id: terraform_fmt
args: [--args=-write=true]

- repo: https://github.com/psf/black
rev: 22.3.0
rev: 23.3.0
hooks:
- id: black
args: [--skip-string-normalization, --line-length=100, backend/users]
language_version: python3.11

- repo: https://github.com/pre-commit/pre-commit-hooks
- repo: https://github.com/timothycrosley/isort
rev: 5.12.0
hooks:
- id: isort
args: [--profile=black]

- repo: https://github.com/asottile/add-trailing-comma
rev: v2.4.0
hooks:
- id: add-trailing-comma

- repo: https://github.com/pycqa/flake8.git
rev: 6.0.0
hooks:
- id: flake8
args: [--config=backend/users/.flake8, backend/users]
language_version: python3.11
args: [--config, backend/users/.flake8]
additional_dependencies: [
"flake8-bugbear",
"flake8-builtins",
"pep8-naming",
"flake8-commas",
"flake8-quotes",
"flake8-todo",
"flake8-django",
"flake8-cognitive-complexity"
]
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from django.contrib.auth.management.commands.createsuperuser import Command as SuperUserCommand

from administrator.models import Admin
from django.contrib.auth.management.commands.createsuperuser import (
Command as SuperUserCommand,
)


class Command(SuperUserCommand):
Expand Down
29 changes: 21 additions & 8 deletions backend/users/backend/administrator/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Generated by Django 4.1.7 on 2023-05-02 11:09

import uuid

import django.contrib.auth.models
import django.contrib.auth.validators
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import uuid
from django.db import migrations, models


class Migration(migrations.Migration):

initial = True

dependencies = [
Expand All @@ -25,7 +25,10 @@ class Migration(migrations.Migration):
(
'id',
models.BigAutoField(
auto_created=True, primary_key=True, serialize=False, verbose_name='ID'
auto_created=True,
primary_key=True,
serialize=False,
verbose_name='ID',
),
),
('name', models.CharField(max_length=255, verbose_name='name')),
Expand All @@ -49,7 +52,10 @@ class Migration(migrations.Migration):
(
'id',
models.BigAutoField(
auto_created=True, primary_key=True, serialize=False, verbose_name='ID'
auto_created=True,
primary_key=True,
serialize=False,
verbose_name='ID',
),
),
('name', models.CharField(max_length=150, unique=True, verbose_name='name')),
Expand Down Expand Up @@ -112,19 +118,26 @@ class Migration(migrations.Migration):
(
'date_joined',
models.DateTimeField(
default=django.utils.timezone.now, verbose_name='date joined'
default=django.utils.timezone.now,
verbose_name='date joined',
),
),
(
'id',
models.UUIDField(
default=uuid.uuid4, editable=False, primary_key=True, serialize=False
default=uuid.uuid4,
editable=False,
primary_key=True,
serialize=False,
),
),
(
'email',
models.EmailField(
db_index=True, max_length=254, unique=True, verbose_name='email address'
db_index=True,
max_length=254,
unique=True,
verbose_name='email address',
),
),
(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class Migration(migrations.Migration):

dependencies = [
('administrator', '0001_initial'),
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class Migration(migrations.Migration):

dependencies = [
('administrator', '0002_remove_admin_date_joined'),
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# Generated by Django 4.1.7 on 2023-05-05 20:35

from django.db import migrations, models
import django.db.models.deletion
from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('common', '0002_alter_contacttype_options_alter_country_id_and_more'),
('administrator', '0003_remove_admin_last_login'),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
# Generated by Django 4.2.2 on 2023-06-13 15:20

import administrator.models
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
('customer', '0004_alter_customeruser_managers'),
('administrator', '0004_alter_adminpermission_options_and_more'),
Expand All @@ -26,7 +25,10 @@ class Migration(migrations.Migration):
(
'id',
models.BigAutoField(
auto_created=True, primary_key=True, serialize=False, verbose_name='ID'
auto_created=True,
primary_key=True,
serialize=False,
verbose_name='ID',
),
),
('reason', models.CharField(max_length=255, verbose_name='block reason')),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
# Generated by Django 4.2.2 on 2023-06-20 05:17

from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('customer', '0004_alter_customeruser_managers'),
('developer', '0006_company_is_banned'),
Expand All @@ -21,7 +20,10 @@ class Migration(migrations.Migration):
(
'id',
models.BigAutoField(
auto_created=True, primary_key=True, serialize=False, verbose_name='ID'
auto_created=True,
primary_key=True,
serialize=False,
verbose_name='ID',
),
),
(
Expand Down Expand Up @@ -66,7 +68,10 @@ class Migration(migrations.Migration):
(
'id',
models.BigAutoField(
auto_created=True, primary_key=True, serialize=False, verbose_name='ID'
auto_created=True,
primary_key=True,
serialize=False,
verbose_name='ID',
),
),
(
Expand Down Expand Up @@ -111,7 +116,10 @@ class Migration(migrations.Migration):
(
'id',
models.BigAutoField(
auto_created=True, primary_key=True, serialize=False, verbose_name='ID'
auto_created=True,
primary_key=True,
serialize=False,
verbose_name='ID',
),
),
(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class Migration(migrations.Migration):

dependencies = [
('administrator', '0006_companymoderate_companyusermoderate_customermoderate_and_more'),
]
Expand Down
Loading

0 comments on commit 1d2eedd

Please sign in to comment.