Return-Path: X-Original-To: apmail-cordova-dev-archive@www.apache.org Delivered-To: apmail-cordova-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 841EF110D9 for ; Mon, 18 Aug 2014 15:00:21 +0000 (UTC) Received: (qmail 48369 invoked by uid 500); 18 Aug 2014 15:00:21 -0000 Delivered-To: apmail-cordova-dev-archive@cordova.apache.org Received: (qmail 48338 invoked by uid 500); 18 Aug 2014 15:00:21 -0000 Mailing-List: contact dev-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list dev@cordova.apache.org Received: (qmail 48325 invoked by uid 99); 18 Aug 2014 15:00:20 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Aug 2014 15:00:20 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of mmocny@google.com designates 209.85.213.173 as permitted sender) Received: from [209.85.213.173] (HELO mail-ig0-f173.google.com) (209.85.213.173) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Aug 2014 14:59:54 +0000 Received: by mail-ig0-f173.google.com with SMTP id h18so8369854igc.0 for ; Mon, 18 Aug 2014 07:59:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=Cvk/j171KMZjZqW4+SI96WMSDGVw7hB2jInqxWyFe0w=; b=NaEfzivktOYrku76fvqb6ENtr6ZkA+7oGfR85i4kWJ2PNFkXl71Ck2qDrZN46RLOum fIY4eaeyTDfgEmrM4TZ/yosGuNkT+LijTjddDcID5ZqIH8urn1G7xr5Bp221es1qFrNA R7PbNEPzJtVwKOZs1KnfMZHC1bIbUhtPGhx8IOXh0O8M0cZQoyHuGrbbG7VBeEATeWaQ Q6AfZOlavhuycpPFz1Jwd7uWwZmbfg2sL2AxTTIGbt7vGflPzODUye81NhUFPSaZMr70 HpO2Mn9OIW8CQ7ntxmhWLni3PPsr9Fjq0bXacOetcsIo/YvHyFNXURcA7weIYkV1vIkQ uVgg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=Cvk/j171KMZjZqW4+SI96WMSDGVw7hB2jInqxWyFe0w=; b=bAWohWxtXoc/GhBWIXj6WKrEik3T0kcyPZjsDHQ/VQZOWwmczpiWwttYYCsmn0Tdkn WVYMtUbekXYFA4ok4asrx7ihHAPCrBR8ocpFRPyCbb2xX26hIXVk++aITmmtYzLBNQCW +waKm8//jGZU0ulrSV8FdVmH+N8ODPwAkeALI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-type; bh=Cvk/j171KMZjZqW4+SI96WMSDGVw7hB2jInqxWyFe0w=; b=CNqIyAb6r/wz9+HgXlAuZAnlxX3N37MwXcNNbepbq2KjX38NiEN9GTpTkLIONgqDIf prS/xWm9kqsH5wehti5cMYCJCCF8J7KrwGQQWDVITNhK/6dHrDlNLvby3N/QlucGVf+p /jkgAd6M1tjnCovukuDgRtQ5L2wiHkaO1RNwp2KPbSnr7CjBwYDc7jJkySYInhHCGtNC XYJRedovNYgovoXu6MkxebS9aCfsX1F2mf0Un90SJEEo+HwiU9ia4OCpeD+X2foQi9WD lxpLS9v8eTLtfXQLGFEu9Cm0nb8dZGB7DDnXSidGsuX+LD90fuyHcEkT5wMXuTxw8Xoh IqFg== X-Gm-Message-State: ALoCoQk2oAE7IHQZsDP/+xbRJUP3n/ODw+WT/fIse38O9PkblE8JwvwlDX5B8ipjU5CA29TgaPk+ X-Received: by 10.43.74.5 with SMTP id yu5mr1456347icb.84.1408373992643; Mon, 18 Aug 2014 07:59:52 -0700 (PDT) MIME-Version: 1.0 Sender: mmocny@google.com Received: by 10.64.59.168 with HTTP; Mon, 18 Aug 2014 07:59:32 -0700 (PDT) In-Reply-To: References: From: Michal Mocny Date: Mon, 18 Aug 2014 10:59:32 -0400 X-Google-Sender-Auth: Ts9urzSPi3LG7PnO8304xeeSDEo Message-ID: Subject: Re: Experimenting with JSCS + JSHint in cordova-lib To: Michal Mocny Cc: dev Content-Type: multipart/alternative; boundary=001a11c1e8568af3ec0500e89fb9 X-Virus-Checked: Checked by ClamAV on apache.org --001a11c1e8568af3ec0500e89fb9 Content-Type: text/plain; charset=UTF-8 Been playing with these settings, pretty awesome so far. How do we feel about adding a check for spaces between concatenation/arithmetic: 'test'+b => 'test' + b? On Fri, Aug 1, 2014 at 8:25 PM, Michal Mocny wrote: > lgtm > > > On Fri, Aug 1, 2014 at 4:42 PM, Steven Gill > wrote: > >> All three parts look good to me! >> >> >> On Fri, Aug 1, 2014 at 1:15 PM, Mark Koudritsky >> wrote: >> >> > With and empty config file JSCS would emit no errors whatsoever. As more >> > options are added, the more of a style JSCS enforces. Let's try it this >> > way, I'll split the current config file into 3 sections and people >> comment >> > whether they think it should be enforced: >> > >> > ## Part 1, the whitespace basics I've rarely seen disagreement about >> > Option names are self explanatory. >> > >> > "disallowMixedSpacesAndTabs": true, >> > "disallowTrailingWhitespace": true, >> > "validateLineBreaks": "LF", >> > "validateIndentation": 4, >> > "requireLineFeedAtFileEnd": true, >> > >> > ## Part 2, not universal but very common conventions. >> > >> > "disallowSpaceAfterPrefixUnaryOperators": true, >> > "disallowSpaceBeforePostfixUnaryOperators": true, >> > "requireSpaceAfterLineComment": true, >> > "requireCapitalizedConstructors": true, >> > cordova-lib code currently violates the last one with lower case >> > constructors for hooker() (but that's being replaces in PR 55 >> > ) and >> platfroms[].parser. >> > >> > >> > ## Part 3, somewhat arguable things but mostly adhered to by the >> existing >> > cordova-lib code >> > // function f(x) is ok but function f (x) is not: >> > "disallowSpacesInNamedFunctionExpression": { >> > "beforeOpeningRoundBrace": true >> > }, >> > // if (x>0) is ok but if(x>0) is not./ >> > "requireSpaceAfterKeywords": [ >> > "if", >> > "else", >> > "for", >> > "while", >> > "do" >> > ] >> > >> > We could potentially add way way more options and create a fully fledged >> > tight style, but that's definitely not my goal :) >> > >> > >> > >> > On Fri, Aug 1, 2014 at 2:56 PM, Steven Gill >> > wrote: >> > >> > > I personally am a little hesitant to have to follow a certain coding >> > style >> > > + am worried about outside contributors struggling with it. On the >> other >> > > hand, it would be nice for code readability to have uniform/consistent >> > > style. >> > > >> > > As long as we discuss what styles we want to use beforehand, I am >> open to >> > > it. >> > > >> > > >> > > On Thu, Jul 31, 2014 at 7:34 PM, Mark Koudritsky >> > > wrote: >> > > >> > > > Just opened a pull request with an experimental JSCS config. Would >> be >> > > glad >> > > > to get some feedback about this. My goal is to eventually run JSCS >> > > together >> > > > with JSHint as part of `npm test`. This is a relatively liberal >> config >> > > that >> > > > doesn't generate too many warnings with the existing code. >> > > > >> > > > https://github.com/apache/cordova-lib/pull/69 >> > > > >> > > > >> > > > ## Some background >> > > > >> > > > JSHint people want to focus on syntax linting and are dropping style >> > > > oriented >> > > > options. They recommend using JSCS (in addition to JSHint) for >> style: >> > > > https://github.com/jshint/jshint/issues/1339 >> > > > >> > > > Options dropped from JSHint were added to JSCS some time ago: >> > > > https://github.com/mdevils/node-jscs/issues/102 >> > > > >> > > > I'm using it with SublimeLinter-jscs >> > > > https://sublime.wbond.net/packages/SublimeLinter-jscs >> > > > >> > > >> > >> > > --001a11c1e8568af3ec0500e89fb9--