Skip to content
This repository has been archived by the owner on Sep 3, 2020. It is now read-only.

Enforce pep8 in server-backend #94

Merged
merged 4 commits into from
Jun 10, 2020
Merged

Enforce pep8 in server-backend #94

merged 4 commits into from
Jun 10, 2020

Conversation

notarock
Copy link
Member

@notarock notarock commented May 17, 2020

  • Applique PEP8 sur tout le code python en utilisant autopep8
  • Ajoute un script bien simple qui lint tous les fichiers
  • Le CI plante si autopep --diff affiche du texte. Cela veut dire que le code n'est pas conforme à PEP8.

@notarock notarock marked this pull request as ready for review May 17, 2020 04:41
@notarock notarock requested review from AXDOOMER, berbiche and Perceval62 and removed request for AXDOOMER May 17, 2020 04:41
@notarock
Copy link
Member Author

Ferme 1/3 de #89

serveur-web/api-v2/app.py Outdated Show resolved Hide resolved
Copy link
Member

@AXDOOMER AXDOOMER left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Je bloque le PR, faut trouver une solution pour les doc strings.

@notarock
Copy link
Member Author

faut trouver une solution pour les doc strings.

Probablement suivre pep8 et mettre la docstring dans la fonction, m'a le fix quand je vais avoir le temps

@notarock notarock requested a review from AXDOOMER May 20, 2020 01:36
serveur-web/api-v2/app_tests.py Show resolved Hide resolved
serveur-web/api-v2/app_tests.py Outdated Show resolved Hide resolved
serveur-web/api-v2/app_tests.py Outdated Show resolved Hide resolved
@AXDOOMER
Copy link
Member

Le lint a pas poigné l'erreur des ", est-ce que c'est possible de configurer le lint pour qu'il attrape ces erreurs?

@notarock
Copy link
Member Author

Le lint a pas poigné l'erreur des ", est-ce que c'est possible de configurer le lint pour qu'il attrape ces erreurs?

Je vais checker, mais je pense que le linter crois que le " fait parti de la docstring.

@notarock notarock requested a review from AXDOOMER May 21, 2020 14:38
Copy link
Member

@AXDOOMER AXDOOMER left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Le linter est pas aussi intelligent qu'un humain pour faire du code beau. Please fix.

serveur-web/api-v2/controller/sensor.py Show resolved Hide resolved
serveur-web/api-v2/database/migration.py Show resolved Hide resolved
serveur-web/api-v2/model/bucket.py Show resolved Hide resolved
serveur-web/api-v2/mqtt/fakejardin.py Outdated Show resolved Hide resolved
serveur-web/api-v2/router/sensor.py Show resolved Hide resolved
serveur-web/api-v2/router/sensor.py Show resolved Hide resolved
serveur-web/api-v2/model/bucket.py Outdated Show resolved Hide resolved
serveur-web/api-v2/controller/bucket.py Outdated Show resolved Hide resolved
@AXDOOMER
Copy link
Member

AXDOOMER commented May 22, 2020

Pourquoi est-ce que j'aime pas PEP8 déjà? Ah oui, les retours de ligne forcés à 79 caractères. Encore un choix qui n'est pas basé sur la science et l'aspect pratique. Le linter enforce toutes ces règles sans esprit critique.

Screenshot_2020-05-22_10-20-43

serveur-web/api-v2/model/bucket.py Outdated Show resolved Hide resolved
serveur-web/api-v2/mqtt/fakejardin.py Outdated Show resolved Hide resolved
serveur-web/api-v2/mqtt/mqttmain.py Outdated Show resolved Hide resolved
@AXDOOMER
Copy link
Member

L'origine de "80 colonnes par ligne de code" :
image

@notarock notarock force-pushed the lint-backend branch 2 times, most recently from ae7a17c to ac4631f Compare May 27, 2020 02:50
@notarock
Copy link
Member Author

J'ai fix le 120 char, la docstring, toute la patente

@AXDOOMER
Copy link
Member

Nice, je vais review prochainement.

serveur-web/api-v2/mqtt/fakejardin.py Show resolved Hide resolved
serveur-web/api-v2/mqtt/fakejardin.py Outdated Show resolved Hide resolved
serveur-web/api-v2/mqtt/mqttmain.py Show resolved Hide resolved
serveur-web/api-v2/mqtt/mqttmain.py Show resolved Hide resolved
serveur-web/api-v2/database/migration.py Show resolved Hide resolved
berbiche
berbiche previously approved these changes May 27, 2020
Copy link
Member

@berbiche berbiche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Juste corrigé les points soulevés par @AXDOOMER

@berbiche
Copy link
Member

berbiche commented Jun 6, 2020

@notarock ping

serveur-web/api-v2/mqtt/fakejardin.py Outdated Show resolved Hide resolved
serveur-web/api-v2/mqtt/fakejardin.py Outdated Show resolved Hide resolved
@notarock notarock requested a review from AXDOOMER June 10, 2020 03:53
Copy link
Member

@AXDOOMER AXDOOMER left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, je pense que c'est good. Je vais le tester plus tard (rouler le code), je m'en occuperai moi même s'il y a de quoi qui arrive à ce point là.

@notarock notarock merged commit ae433e4 into master Jun 10, 2020
@notarock notarock deleted the lint-backend branch June 10, 2020 14:43
@mikefaille
Copy link
Member

beau

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants