Re: [Puppet-dev] Re: RFC: Static Analysis of the Puppet project

2014-08-15 Thread Kylo Ginsberg
On Mon, Aug 11, 2014 at 11:23 AM, Henrik Lindberg < henrik.lindb...@cloudsmith.com> wrote: > On 2014-11-08 19:06, Trevor Vaughan wrote: > >> I prefer: >> >> cmd x or return nil >> >> as opposed to, if x then return nil, just because it flows better. >> >> Technically, though, a standard should be

[Puppet-dev] Re: RFC: Static Analysis of the Puppet project

2014-08-11 Thread Henrik Lindberg
On 2014-11-08 19:06, Trevor Vaughan wrote: I prefer: cmd x or return nil as opposed to, if x then return nil, just because it flows better. Technically, though, a standard should be standard even if it's a bit irritating at times and I think that this one might qualify. Trevor It depends v

Re: [Puppet-dev] Re: RFC: Static Analysis of the Puppet project

2014-08-11 Thread Trevor Vaughan
I prefer: cmd x or return nil as opposed to, if x then return nil, just because it flows better. Technically, though, a standard should be standard even if it's a bit irritating at times and I think that this one might qualify. Trevor On Mon, Aug 11, 2014 at 1:01 PM, Rahul Gopinath wrote: >

Re: [Puppet-dev] Re: RFC: Static Analysis of the Puppet project

2014-08-11 Thread Rahul Gopinath
Thanks, So just to confirm, we can try to enforce method call parenthesis in conditionals (Does any one else have any objections?) On a related note, As Adrien noted, there are a few legitimate use cases for `and` and `or` keywords, where they function as control flow operators, and help readab

[Puppet-dev] Re: RFC: Static Analysis of the Puppet project

2014-08-11 Thread Henrik Lindberg
On 2014-11-08 17:44, Rahul Gopinath wrote: I agree with leaving () out for the DSL usage. Are there any such instances of DSL usage within conditionals (if/unless/while...)? If not, would you be in favor if we restrict the enforcement to conditionals only? I think that would be rare (if at al

Re: [Puppet-dev] Re: RFC: Static Analysis of the Puppet project

2014-08-11 Thread Rahul Gopinath
I agree with leaving () out for the DSL usage. Are there any such instances of DSL usage within conditionals (if/unless/while...)? If not, would you be in favor if we restrict the enforcement to conditionals only? On Mon, Aug 11, 2014 at 7:00 AM, Henrik Lindberg wrote: > On 2014-11-08 2:01, Ky

[Puppet-dev] Re: RFC: Static Analysis of the Puppet project

2014-08-11 Thread Henrik Lindberg
On 2014-11-08 2:01, Kylo Ginsberg wrote: On Sat, Aug 9, 2014 at 9:45 AM, Henrik Lindberg mailto:henrik.lindb...@cloudsmith.com>> wrote: On 2014-09-08 24:13, Andy Parker wrote: On Fri, Aug 8, 2014 at 3:11 PM, Rahul Gopinath mailto:ra...@puppetlabs.com>

Re: [Puppet-dev] Re: RFC: Static Analysis of the Puppet project

2014-08-10 Thread Rahul Gopinath
Here is a related issue, I notice that there are different conventions for spacing followed when using method calls with parenthesis, including `method(a,b)`, `method( a, b )` and `method( a,b )`. Does the list have a preference for one of the styles when I add parenthesis (to those methods that a

Re: [Puppet-dev] Re: RFC: Static Analysis of the Puppet project

2014-08-10 Thread Kylo Ginsberg
On Sat, Aug 9, 2014 at 9:45 AM, Henrik Lindberg < henrik.lindb...@cloudsmith.com> wrote: > On 2014-09-08 24:13, Andy Parker wrote: > >> On Fri, Aug 8, 2014 at 3:11 PM, Rahul Gopinath > > wrote: >> >> While correcting AndOr, I come across methods calls such as `if

[Puppet-dev] Re: RFC: Static Analysis of the Puppet project

2014-08-09 Thread Henrik Lindberg
On 2014-09-08 24:13, Andy Parker wrote: On Fri, Aug 8, 2014 at 3:11 PM, Rahul Gopinath mailto:ra...@puppetlabs.com>> wrote: While correcting AndOr, I come across methods calls such as `if value.is_a? FixNum or value.is_a? Integer` How should we parenthesize it? is it `(value.is_a?

Re: [Puppet-dev] Re: RFC: Static Analysis of the Puppet project

2014-07-29 Thread Kylo Ginsberg
On Tue, Jul 29, 2014 at 6:08 PM, Daniele Sluijters < daniele.sluijt...@gmail.com> wrote: > Because 3 is always better than 2 SaaS services, has any consideration > been given to Codeclimate? We've been using it at Nedap for a while now and > so far it has helped identify some (big) issues in our c

Re: [Puppet-dev] Re: RFC: Static Analysis of the Puppet project

2014-07-29 Thread Rahul Gopinath
On Tue, Jul 29, 2014 at 6:08 PM, Daniele Sluijters wrote: > Codeclimate I haven't actually, but it seems that the tools they use on ruby is Flog and Flay[1] which looks for duplication and complexity, and these I had looked at individually. They are useful at what they do, though as you point out

[Puppet-dev] Re: RFC: Static Analysis of the Puppet project

2014-07-29 Thread Daniele Sluijters
Because 3 is always better than 2 SaaS services, has any consideration been given to Codeclimate? We've been using it at Nedap for a while now and so far it has helped identify some (big) issues in our code bases and helped us keep new projects on track. Their 'security monitor' is remarkably u

[Puppet-dev] Re: RFC: Static Analysis of the Puppet project

2014-07-15 Thread Henrik Lindberg
On 2014-15-07 21:41, Andy Parker wrote: On Tue, Jul 15, 2014 at 11:01 AM, rahul mailto:ra...@puppetlabs.com>> wrote: [..snip..] and then there's been some discussion on the PR around these two cops: Style/AndOr Lint/AssignmentInCondition

[Puppet-dev] Re: RFC: Static Analysis of the Puppet project

2014-07-14 Thread Henrik Lindberg
On 2014-15-07 24:08, Kylo Ginsberg wrote: So now putting on my opinionated hat ;) On Mon, Jul 14, 2014 at 12:04 PM, Andy Parker mailto:a...@puppetlabs.com>> wrote: On Mon, Jul 14, 2014 at 10:56 AM, Kylo Ginsberg mailto:k...@puppetlabs.com>> wrote: For the build and test pipeline in