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

Ameliorations de code conseillées par landscape #2712

Merged
merged 1 commit into from
Jun 3, 2015
Merged

Ameliorations de code conseillées par landscape #2712

merged 1 commit into from
Jun 3, 2015

Conversation

Eskimon
Copy link
Contributor

@Eskimon Eskimon commented May 15, 2015

Q R
Correction de bugs ? non
Nouvelle Fonctionnalité ? non
Tickets (issues) concernés N/A

Ce ticket propose quelques améliorations de code conseillées par landscape. Il y a encore du boulot mais c'est un début.
Grosso modo :

  • Des noms de variables sont devenues un peu peu littéral
  • Des noms de variables interdit (list) ont été remplace pour éviter les confusions
  • J'ai vire quelques contraintes pour lesquels nous ne ferons probablement jamais rien
  • ...

J'ai volontairement ignoré les modules articles, tutos et mp (car les deux premiers vont beaucoup changer avec la ZEP-12 et le module tuto peut-etre aussi avec l'API en dev dessus)

@SpaceFox SpaceFox added Evolution C-Back Concerne le back-end Django labels May 15, 2015
# Index
url(r'^$', ListGallery.as_view(), name='gallery-list'),
)
# Add and edit a gallery
Copy link
Contributor

Choose a reason for hiding this comment

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

Ne peut-on pas plutôt modifier la règle ? Pour moi, ici l'ancienne version était bien plus lisible que la nouvelle, et l'important, c'est la lisibilité et pas les règles.

@landscape-bot
Copy link

Code Health
Repository health increased by 0.94% when pulling 49cf001 on Eskimon:tweak-landscape into 93559e3 on zestedesavoir:dev.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) to 81.93% when pulling 49cf001 on Eskimon:tweak-landscape into 93559e3 on zestedesavoir:dev.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) to 81.93% when pulling 0201bd9 on Eskimon:tweak-landscape into 93559e3 on zestedesavoir:dev.

@landscape-bot
Copy link

Code Health
Repository health increased by 0.96% when pulling 0201bd9 on Eskimon:tweak-landscape into 93559e3 on zestedesavoir:dev.

@landscape-bot
Copy link

Code Health
Repository health increased by 2% when pulling c66f7d6 on Eskimon:tweak-landscape into 93559e3 on zestedesavoir:dev.

1 similar comment
@landscape-bot
Copy link

Code Health
Repository health increased by 2% when pulling c66f7d6 on Eskimon:tweak-landscape into 93559e3 on zestedesavoir:dev.

@landscape-bot
Copy link

Code Health
Repository health increased by 2% when pulling ea18c47 on Eskimon:tweak-landscape into 93559e3 on zestedesavoir:dev.

@pierre-24
Copy link
Member

Y'a encore des trucs à faire, par ici ? (à priori, j'ai rien vu de farfelu dans le code).

@Eskimon
Copy link
Contributor Author

Eskimon commented May 18, 2015

Oui, j'attends le merge de la PR de @GerardPaligot sur le module des forums pour repasser sur ce dernier si nécessaire.

@pierre-24
Copy link
Member

Vu :)

@Eskimon
Copy link
Contributor Author

Eskimon commented May 20, 2015

Voila, edit des forums fait en me rebasant sur dev... Cependant c'est du push sauvage, j'ai pas eu le temps de lancer les tests sur ma machine ce soir... (du coup "on verra Travis" dans un premier temps)

@landscape-bot
Copy link

Code Health
Repository health increased by 2% when pulling 9fb687a on Eskimon:tweak-landscape into 8e61c96 on zestedesavoir:dev.

@Eskimon
Copy link
Contributor Author

Eskimon commented May 21, 2015

Hum, plein d'erreurs, toutes sur les fofos... je regarde ca...

@Eskimon
Copy link
Contributor Author

Eskimon commented May 21, 2015

Bon voila normalement tout passe. Ca m'aurait fait corrige des soucis dans le code qui passait inaperçu a cause d' except sans filtre.

@landscape-bot
Copy link

Code Health
Repository health increased by 2% when pulling 4538930 on Eskimon:tweak-landscape into 8e61c96 on zestedesavoir:dev.

@@ -760,7 +760,7 @@ def test_filter_member_ip(self):
# Check that the filter can't be access from normal user
result = self.client.post(
reverse('zds.member.views.member_from_ip',
kwargs={'ip': tester.last_ip_address}),
kwargs={'ipadress': tester.last_ip_address}),
Copy link
Member

Choose a reason for hiding this comment

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

ip_address

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.04%) to 83.76% when pulling 2703138 on Eskimon:tweak-landscape into 3e91b08 on zestedesavoir:dev.

@artragis artragis mentioned this pull request Jun 2, 2015
@Eskimon
Copy link
Contributor Author

Eskimon commented Jun 2, 2015

Bon, petit push pour avoir un coverage/landscape/travis AVANT le rebase de la PR d' @artragis <3

@landscape-bot
Copy link

Code Health
Repository health increased by 2% when pulling d80e91d on Eskimon:tweak-landscape into 4681820 on zestedesavoir:dev.

@Eskimon
Copy link
Contributor Author

Eskimon commented Jun 2, 2015

ET PAF le rebase de la PR d'artragis qui c'est fait tout seul (sauf pour templatetags/profile.py mais c'etait peanuts a faire)

@landscape-bot
Copy link

Code Health
Repository health increased by 2% when pulling d8e4c14 on Eskimon:tweak-landscape into 4681820 on zestedesavoir:dev.

@landscape-bot
Copy link

Code Health
Repository health increased by 2% when pulling b85c519 on Eskimon:tweak-landscape into 4681820 on zestedesavoir:dev.

@@ -102,7 +102,7 @@ def items(self, obj):
if "forum" not in obj and "tag" not in obj:
topics = Topic.objects.filter(forum__group__isnull=True)\
.order_by('-pubdate')[:settings.ZDS_APP['forum']['posts_per_page']]
except:
except (Post.DoesNotExist, ValueError):
Copy link
Member

Choose a reason for hiding this comment

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

C'est pas plutôt Topic.DoesNotExist ici ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Si. C'est ce qui se passe quand on laisse un boulet copier/coller !

@landscape-bot
Copy link

Code Health
Repository health increased by 2% when pulling a08ade5 on Eskimon:tweak-landscape into 4681820 on zestedesavoir:dev.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.04%) to 83.77% when pulling a08ade5 on Eskimon:tweak-landscape into 4681820 on zestedesavoir:dev.

@Eskimon
Copy link
Contributor Author

Eskimon commented Jun 2, 2015

D'autres choses à dire ?

@firm1
Copy link
Contributor

firm1 commented Jun 2, 2015

D'autres choses à dire ?

Perso je n'ai plus aucune remarque à faire.

@@ -592,11 +592,11 @@ def followed_topics(request):
Displays the followed topics fo the current user, with `settings.ZDS_APP['forum']['followed_topics_per_page']`
topics per page.
"""
followed_topics = request.user.profile.get_followed_topics()
topics_followed = request.user.profile.get_followed_topics()
Copy link
Member

Choose a reason for hiding this comment

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

Pourquoi ? Je trouvais ça mieux followed_topics !

Copy link
Contributor Author

Choose a reason for hiding this comment

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

parce que c'est le nom de la fonction

@Situphen
Copy link
Member

Situphen commented Jun 2, 2015

A part mes quelques commentaires, ça m'a l'air tout bon pour le merge !

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.04%) to 83.77% when pulling 66be950 on Eskimon:tweak-landscape into 4681820 on zestedesavoir:dev.

@Eskimon
Copy link
Contributor Author

Eskimon commented Jun 3, 2015

Voili voilou !

@landscape-bot
Copy link

Code Health
Repository health increased by 2% when pulling 66be950 on Eskimon:tweak-landscape into 4681820 on zestedesavoir:dev.

@Situphen
Copy link
Member

Situphen commented Jun 3, 2015

Vu que @SpaceFox @GerardPaligot @artragis @firm1 et moi on a commenté, que Travis est OK et qu'on ne va pas QA tout le site (car ça touche à tout), je merge !

Situphen added a commit that referenced this pull request Jun 3, 2015
Ameliorations de code conseillées par landscape
@Situphen Situphen merged commit 3e59ec4 into zestedesavoir:dev Jun 3, 2015
@firm1 firm1 removed the Evolution label Jun 3, 2015
@Situphen Situphen added this to the Version de développement milestone Jun 3, 2015
@Eskimon
Copy link
Contributor Author

Eskimon commented Jun 3, 2015

@GerardPaligot le coverage ne compte pas ici, je ne touche pas au test. C'est le score landscape qui est cense bouger :)

@GerardPaligot
Copy link
Member

Tu as été rapide. J'ai supprimé mon message direct en comprenant que c'était sur landscape que tu avais bossé et pas coveralls. :)

@Eskimon Eskimon deleted the tweak-landscape branch October 19, 2015 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-Back Concerne le back-end Django
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants