Skip to content

Commit

Permalink
style(#37): Style whole project using pre-commit config
Browse files Browse the repository at this point in the history
  • Loading branch information
ezegonmac committed Dec 13, 2022
1 parent 55e3af9 commit 5802cf8
Show file tree
Hide file tree
Showing 56 changed files with 1,324 additions and 865 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ name: Innosoft eventos GA

on:
push:
branches:
branches:
- main
- feature/**
pull_request:
branches:
branches:
- main

env:
Expand All @@ -30,7 +30,7 @@ jobs:
ports:
- 3307:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3

steps:
- uses: actions/checkout@v2
- name: Verify and configure MySQL connection
Expand All @@ -49,13 +49,13 @@ jobs:
pip install codacy-coverage
sudo apt-get install chromium-browser chromium-chromedriver
- name: Make Migrations and Migrate
run: |
run: |
python ./manage.py makemigrations
python ./manage.py migrate
- name: Run Tests
run: |
coverage run --branch --source=. ./manage.py test --keepdb
coverage xml
run: |
coverage run --branch --source=. ./manage.py test --keepdb
coverage xml
- name: Codacy Coverage Reporter
uses: codacy/codacy-coverage-reporter-action@v1
with:
Expand Down
184 changes: 92 additions & 92 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ __pycache__
media
/**/migrations/**

# Backup files #
*.bak
# Backup files #
*.bak

# If you are using PyCharm #
# If you are using PyCharm #
# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
Expand Down Expand Up @@ -46,93 +46,93 @@ out/
# JIRA plugin
atlassian-ide-plugin.xml

# Python #
*.py[cod]
*$py.class

# Distribution / packaging
.Python build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
.pytest_cache/
nosetests.xml
coverage.xml
*.cover
.hypothesis/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery
celerybeat-schedule.*

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# mkdocs documentation
/site

# mypy
.mypy_cache/

# Sublime Text #
*.tmlanguage.cache
*.tmPreferences.cache
*.stTheme.cache
*.sublime-workspace
*.sublime-project

# sftp configuration file
sftp-config.json

# Package control specific files Package
Control.last-run
Control.ca-list
Control.ca-bundle
Control.system-ca-bundle
GitHub.sublime-settings

# Visual Studio Code #
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
.vscode/launch.json
!.vscode/extensions.json
# Python #
*.py[cod]
*$py.class

# Distribution / packaging
.Python build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
.pytest_cache/
nosetests.xml
coverage.xml
*.cover
.hypothesis/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery
celerybeat-schedule.*

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# mkdocs documentation
/site

# mypy
.mypy_cache/

# Sublime Text #
*.tmlanguage.cache
*.tmPreferences.cache
*.stTheme.cache
*.sublime-workspace
*.sublime-project

# sftp configuration file
sftp-config.json

# Package control specific files Package
Control.last-run
Control.ca-list
Control.ca-bundle
Control.system-ca-bundle
GitHub.sublime-settings

# Visual Studio Code #
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
.vscode/launch.json
!.vscode/extensions.json
.history
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ repos:
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
types: [python, javascript, html, css]
- repo: https://github.com/psf/black
rev: 22.12.0
hooks:
Expand Down
4 changes: 2 additions & 2 deletions accounts/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@


class AccountsConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'accounts'
default_auto_field = "django.db.models.BigAutoField"
name = "accounts"
12 changes: 10 additions & 2 deletions accounts/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,18 @@

from participant.models import Participant


class RegisterForm(UserCreationForm):
email = forms.EmailField()

class Meta:
model = Participant
fields = ['username', 'first_name', 'last_name', 'email', 'password1', 'password2', 'photo']

fields = [
"username",
"first_name",
"last_name",
"email",
"password1",
"password2",
"photo",
]
2 changes: 1 addition & 1 deletion accounts/templates/register.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{% block content %}
<div class="register-layout">
<div class="titulo">

</div>
<div class="container-register">
<form method="POST" action="{% url 'register' %}" class="form-register" novalidate>
Expand Down
4 changes: 2 additions & 2 deletions accounts/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
from accounts.views import *

urlpatterns = [
path('', register, name="register"),
]
path("", register, name="register"),
]
7 changes: 4 additions & 3 deletions accounts/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@

# Create your views here.


def register(request):
if request.method == 'POST':
if request.method == "POST":
form = RegisterForm(request.POST)
if form.is_valid():
form.save()
return redirect('/')
return redirect("/")
else:
form = RegisterForm()
return render(request, 'register.html', {'form': form})
return render(request, "register.html", {"form": form})
10 changes: 5 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: "3"

services:
services:
db:
image: mysql:8
environment:
Expand All @@ -12,12 +12,12 @@ services:
MYSQL_TCP_PORT: "3307"
ports:
- "3306:3307"

web:
build: .
command: >
sh -c "python manage.py makemigrations &&
python manage.py migrate &&
sh -c "python manage.py makemigrations &&
python manage.py migrate &&
python manage.py runserver 0.0.0.0:8000"
volumes:
- .:/code
Expand All @@ -28,4 +28,4 @@ services:
deploy:
restart_policy:
condition: on-failure

3 changes: 2 additions & 1 deletion event/admin.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from django.contrib import admin
from .models import Event

# Register your models here.

admin.site.register(Event)
admin.site.register(Event)
4 changes: 2 additions & 2 deletions event/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@


class EventConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'event'
default_auto_field = "django.db.models.BigAutoField"
name = "event"
Loading

0 comments on commit 5802cf8

Please sign in to comment.