Pasando a utilizar flake8, es mas rapido y confiable
This commit is contained in:
3
.flake8
Normal file
3
.flake8
Normal file
@@ -0,0 +1,3 @@
|
||||
[flake8]
|
||||
max-line-length = 120
|
||||
exclude = __pycache__,.git,.idea,static,venv,users/migrations/
|
||||
@@ -1,20 +1,20 @@
|
||||
image: python:latest
|
||||
|
||||
stages:
|
||||
- test
|
||||
- deploy
|
||||
- Analisis Estatico
|
||||
- Deploy
|
||||
|
||||
before_script:
|
||||
- apt-get update -y && apt-get upgrade -y
|
||||
|
||||
test:
|
||||
stage: test
|
||||
stage: Analisis Estatico
|
||||
script:
|
||||
- pip install -r requirements.txt -r requirements-dev.txt
|
||||
- ./lint.sh
|
||||
- flake8 .
|
||||
|
||||
deploy:
|
||||
stage: deploy
|
||||
stage: Deploy
|
||||
script:
|
||||
## Install ssh-agent if not already installed
|
||||
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client git -y )'
|
||||
@@ -37,4 +37,3 @@ deploy:
|
||||
- apt-get install rsync -y
|
||||
- rsync -rvz ./ deployer@142.93.158.54:/var/www/musiclist.danielcortes.xyz/server/
|
||||
- ssh deployer@142.93.158.54 'cd /var/www/musiclist.danielcortes.xyz/server/; sh deploy.sh'
|
||||
|
||||
|
||||
@@ -6,7 +6,8 @@ musicbrainz entrega exceptuando los errores.
|
||||
from urllib.parse import quote, urlencode
|
||||
import logging
|
||||
import requests
|
||||
from utils import sanitize_keys, ratelimit
|
||||
from utils import sanitize_keys
|
||||
from utils.ratelimit import ratelimit
|
||||
|
||||
HEADERS = {'accept': 'application/json', 'user-agent': 'MusicList/1.0 (danielcortes.xyz)'}
|
||||
MB_HOST = 'https://musicbrainz.org/ws/2'
|
||||
|
||||
6
lint.sh
6
lint.sh
@@ -1,6 +0,0 @@
|
||||
#!/bin/sh
|
||||
plugins="pylint_django"
|
||||
good_names="db"
|
||||
modules="fetcher lists musiclist users utils welcome"
|
||||
pylint --load-plugins $plugins --good-names=$good_names $modules || pylint-exit --error-fail --warn-fail $?
|
||||
exit $?
|
||||
@@ -1,8 +1,8 @@
|
||||
"""
|
||||
Configuración para servidor de producción
|
||||
"""
|
||||
# pylint: disable=wildcard-import disable=unused-wildcard-import
|
||||
from musiclist.settings import *
|
||||
import os
|
||||
from musiclist.settings import * # noqa: F403, F401
|
||||
|
||||
DEBUG = False
|
||||
SECRET_KEY = os.environ.get('DJANGO_SECRET_KEY')
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -eu
|
||||
|
||||
[ -d venv/ ] || python -m venv venv
|
||||
. venv/bin/activate
|
||||
pip install -r requirements.txt -r requirements-dev.txt
|
||||
./lint.sh
|
||||
LINT_RESULT=$?
|
||||
exit $LINT_RESULT
|
||||
flake8 .
|
||||
exit $?
|
||||
|
||||
@@ -1,3 +1 @@
|
||||
pylint # Linting
|
||||
pylint-exit # Maps pylint exit codes to something sane for linux
|
||||
pylint-django # Plugin for pylint that helps with django projects
|
||||
flake8 # Obligar a usar pep8
|
||||
|
||||
@@ -9,10 +9,8 @@ from django.conf import settings
|
||||
|
||||
import redis
|
||||
from pygments import highlight
|
||||
from pygments.lexers import JsonLexer # pylint: disable=no-name-in-module
|
||||
from pygments.formatters import TerminalTrueColorFormatter # pylint: disable=no-name-in-module
|
||||
|
||||
from utils.ratelimit import ratelimit
|
||||
from pygments.lexers import JsonLexer
|
||||
from pygments.formatters import TerminalTrueColorFormatter
|
||||
|
||||
_log = logging.getLogger('utils')
|
||||
_log.addHandler(logging.NullHandler())
|
||||
|
||||
Reference in New Issue
Block a user