[openstack-dev] [nova] Proposal new hacking rules

2014-11-20 Thread Sahid Orentino Ferdjaoui
This is something we can call nitpiking or low priority. I would like we introduce 3 new hacking rules to enforce the cohesion and consistency in the base code. Using boolean assertions Some tests are written with equality assertions to validate boolean conditions which

Re: [openstack-dev] [nova] Proposal new hacking rules

2014-11-20 Thread Joe Gordon
On Thu, Nov 20, 2014 at 9:49 AM, Sahid Orentino Ferdjaoui < sahid.ferdja...@redhat.com> wrote: > This is something we can call nitpiking or low priority. > This all seems like nitpicking for very little value. I think there are better things we can be focusing on instead of thinking of new ways t

Re: [openstack-dev] [nova] Proposal new hacking rules

2014-11-21 Thread Sahid Orentino Ferdjaoui
On Thu, Nov 20, 2014 at 02:00:11PM -0800, Joe Gordon wrote: > On Thu, Nov 20, 2014 at 9:49 AM, Sahid Orentino Ferdjaoui < > sahid.ferdja...@redhat.com> wrote: > > > This is something we can call nitpiking or low priority. > > > > This all seems like nitpicking for very little value. I think there

Re: [openstack-dev] [nova] Proposal new hacking rules

2014-11-21 Thread jordan pittier
re these new rules makes sense on other openstack projects. Jordan - Original Message - From: "Sahid Orentino Ferdjaoui" To: "OpenStack Development Mailing List (not for usage questions)" Sent: Friday, November 21, 2014 5:57:14 PM Subject: Re: [openstack-dev] [nova]

Re: [openstack-dev] [nova] Proposal new hacking rules

2014-11-21 Thread Joe Gordon
On Fri, Nov 21, 2014 at 8:57 AM, Sahid Orentino Ferdjaoui < sahid.ferdja...@redhat.com> wrote: > On Thu, Nov 20, 2014 at 02:00:11PM -0800, Joe Gordon wrote: > > On Thu, Nov 20, 2014 at 9:49 AM, Sahid Orentino Ferdjaoui < > > sahid.ferdja...@redhat.com> wrote: > > > > > This is something we can cal

Re: [openstack-dev] [nova] Proposal new hacking rules

2014-11-21 Thread Matthew Treinish
les to the hacking project here > : https://github.com/openstack-dev/hacking ? I am sure these new rules makes > sense on other openstack projects. > > Jordan > > - Original Message - > From: "Sahid Orentino Ferdjaoui" > To: "OpenStack Developme

Re: [openstack-dev] [nova] Proposal new hacking rules

2014-11-21 Thread Matthew Treinish
On Fri, Nov 21, 2014 at 10:30:59AM -0800, Joe Gordon wrote: > On Fri, Nov 21, 2014 at 8:57 AM, Sahid Orentino Ferdjaoui < > sahid.ferdja...@redhat.com> wrote: > > > On Thu, Nov 20, 2014 at 02:00:11PM -0800, Joe Gordon wrote: > > > On Thu, Nov 20, 2014 at 9:49 AM, Sahid Orentino Ferdjaoui < > > > s

Re: [openstack-dev] [nova] Proposal new hacking rules

2014-11-21 Thread Sean Dague
On 11/21/2014 01:52 PM, Matthew Treinish wrote: > On Fri, Nov 21, 2014 at 07:15:49PM +0100, jordan pittier wrote: >> Hey, >> I am not a Nova developer but I still have an opinion. >> >>> Using boolean assertions >> I like what you propose. We should use and enforce the assert* that best >> matches

Re: [openstack-dev] [nova] Proposal new hacking rules

2014-11-21 Thread Matthew Treinish
On Fri, Nov 21, 2014 at 04:15:07PM -0500, Sean Dague wrote: > On 11/21/2014 01:52 PM, Matthew Treinish wrote: > > On Fri, Nov 21, 2014 at 07:15:49PM +0100, jordan pittier wrote: > >> Hey, > >> I am not a Nova developer but I still have an opinion. > >> > >>> Using boolean assertions > >> I like wha

Re: [openstack-dev] [nova] Proposal new hacking rules

2014-11-23 Thread Solly Ross
Whoops, that should say "assertions" not "exceptions". - Original Message - > From: "Solly Ross" > To: "OpenStack Development Mailing List (not for usage questions)" > > Sent: Monday, November 24, 2014 12:00:44 AM > Subject

Re: [openstack-dev] [nova] Proposal new hacking rules

2014-11-23 Thread Solly Ross
elopment Mailing List (not for usage questions)" > > Sent: Friday, November 21, 2014 5:23:28 PM > Subject: Re: [openstack-dev] [nova] Proposal new hacking rules > > On Fri, Nov 21, 2014 at 04:15:07PM -0500, Sean Dague wrote: > > On 11/21/2014 01:52 PM, Matthew Treinish wro

Re: [openstack-dev] [nova] Proposal new hacking rules

2014-11-24 Thread Sahid Orentino Ferdjaoui
cepted by Nova community first before to think about other projects ;) > > Jordan > > > > - Original Message - > > From: "Sahid Orentino Ferdjaoui" > > To: "OpenStack Development Mailing List (not for usage questions)" > > >

Re: [openstack-dev] [nova] Proposal new hacking rules

2014-11-24 Thread Sahid Orentino Ferdjaoui
On Fri, Nov 21, 2014 at 05:23:28PM -0500, Matthew Treinish wrote: > On Fri, Nov 21, 2014 at 04:15:07PM -0500, Sean Dague wrote: > > On 11/21/2014 01:52 PM, Matthew Treinish wrote: > > > On Fri, Nov 21, 2014 at 07:15:49PM +0100, jordan pittier wrote: > > >> Hey, > > >> I am not a Nova developer but

Re: [openstack-dev] [nova] Proposal new hacking rules

2014-11-24 Thread Sahid Orentino Ferdjaoui
On Fri, Nov 21, 2014 at 10:30:59AM -0800, Joe Gordon wrote: > On Fri, Nov 21, 2014 at 8:57 AM, Sahid Orentino Ferdjaoui < > sahid.ferdja...@redhat.com> wrote: > > > On Thu, Nov 20, 2014 at 02:00:11PM -0800, Joe Gordon wrote: > > > On Thu, Nov 20, 2014 at 9:49 AM, Sahid Orentino Ferdjaoui < > > > s

Re: [openstack-dev] [nova] Proposal new hacking rules

2014-11-24 Thread Matthew Gilliard
1/ assertFalse() vs assertEqual(x, False) - these are semantically different because of python's notion of truthiness, so I don't think we ought to make this a rule. 2/ expected/actual - incorrect failure messages have cost me more time than I should admit to. I don't see any reason not to try to

Re: [openstack-dev] [nova] Proposal new hacking rules

2014-11-24 Thread Alexis Lee
Matthew Gilliard said on Mon, Nov 24, 2014 at 02:50:08PM +: > 1/ assertFalse() vs assertEqual(x, False) - these are semantically > different because of python's notion of truthiness, so I don't think > we ought to make this a rule. > 2/ expected/actual - I don't see any reason not to try to imp

Re: [openstack-dev] [nova] Proposal new hacking rules

2014-11-24 Thread Ben Nemec
On 11/24/2014 08:50 AM, Matthew Gilliard wrote: > 1/ assertFalse() vs assertEqual(x, False) - these are semantically > different because of python's notion of truthiness, so I don't think > we ought to make this a rule. > > 2/ expected/actual - incorrect failure messages have cost me more time > t

Re: [openstack-dev] [nova] Proposal new hacking rules

2014-11-24 Thread pcrews
On 11/24/2014 09:40 AM, Ben Nemec wrote: On 11/24/2014 08:50 AM, Matthew Gilliard wrote: 1/ assertFalse() vs assertEqual(x, False) - these are semantically different because of python's notion of truthiness, so I don't think we ought to make this a rule. 2/ expected/actual - incorrect failure m

Re: [openstack-dev] [nova] Proposal new hacking rules

2014-11-24 Thread Jay Pipes
On 11/24/2014 01:02 PM, pcrews wrote: On 11/24/2014 09:40 AM, Ben Nemec wrote: On 11/24/2014 08:50 AM, Matthew Gilliard wrote: 1/ assertFalse() vs assertEqual(x, False) - these are semantically different because of python's notion of truthiness, so I don't think we ought to make this a rule. 2

Re: [openstack-dev] [nova] Proposal new hacking rules

2014-11-26 Thread Nicolas Trangez
On Mon, 2014-11-24 at 13:19 -0500, Jay Pipes wrote: > I think pointing out that the default failure > message for testtools.TestCase.assertEqual() uses the terms > "reference" > (expected) and "actual" is a reason why reviewers *should* ask patch > submitters to use (expected, actual) ordering.

Re: [openstack-dev] [nova] Proposal new hacking rules

2014-11-26 Thread Jay Pipes
On 11/26/2014 06:20 AM, Nicolas Trangez wrote: On Mon, 2014-11-24 at 13:19 -0500, Jay Pipes wrote: I think pointing out that the default failure message for testtools.TestCase.assertEqual() uses the terms "reference" (expected) and "actual" is a reason why reviewers *should* ask patch submitters

Re: [openstack-dev] [nova] Proposal new hacking rules

2014-11-26 Thread Nicolas Trangez
On Wed, 2014-11-26 at 08:54 -0500, Jay Pipes wrote: > On 11/26/2014 06:20 AM, Nicolas Trangez wrote: > > On Mon, 2014-11-24 at 13:19 -0500, Jay Pipes wrote: > >> I think pointing out that the default failure > >> message for testtools.TestCase.assertEqual() uses the terms > >> "reference" > >> (exp

Re: [openstack-dev] [nova] Proposal new hacking rules

2014-11-26 Thread Louis Taylor
On Wed, Nov 26, 2014 at 08:54:35AM -0500, Jay Pipes wrote: > It's not about an equality condition. > > It's about the message that is produced by testtools.TestCase.assertEqual(), > and the helpfulness of that message when the order of the arguments is > reversed. > > This is especially true with

Re: [openstack-dev] [nova] Proposal new hacking rules

2014-11-26 Thread Jay Pipes
On 11/26/2014 09:28 AM, Nicolas Trangez wrote: On Wed, 2014-11-26 at 08:54 -0500, Jay Pipes wrote: On 11/26/2014 06:20 AM, Nicolas Trangez wrote: On Mon, 2014-11-24 at 13:19 -0500, Jay Pipes wrote: I think pointing out that the default failure message for testtools.TestCase.assertEqual() uses

Re: [openstack-dev] [nova] Proposal new hacking rules

2014-11-26 Thread Ben Nemec
On 11/26/2014 07:54 AM, Jay Pipes wrote: > On 11/26/2014 06:20 AM, Nicolas Trangez wrote: >> On Mon, 2014-11-24 at 13:19 -0500, Jay Pipes wrote: >>> I think pointing out that the default failure >>> message for testtools.TestCase.assertEqual() uses the terms >>> "reference" >>> (expected) and "actu

Re: [openstack-dev] [nova] Proposal new hacking rules

2014-11-26 Thread Zane Bitter
On 26/11/14 09:33, Louis Taylor wrote: On Wed, Nov 26, 2014 at 08:54:35AM -0500, Jay Pipes wrote: It's not about an equality condition. It's about the message that is produced by testtools.TestCase.assertEqual(), and the helpfulness of that message when the order of the arguments is reversed.