Return-Path: X-Original-To: apmail-couchdb-commits-archive@www.apache.org Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 10E351778A for ; Wed, 25 Mar 2015 10:13:59 +0000 (UTC) Received: (qmail 54566 invoked by uid 500); 25 Mar 2015 10:13:58 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 54442 invoked by uid 500); 25 Mar 2015 10:13:58 -0000 Mailing-List: contact commits-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list commits@couchdb.apache.org Received: (qmail 53861 invoked by uid 99); 25 Mar 2015 10:13:58 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Mar 2015 10:13:58 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 33DF4E18E8; Wed, 25 Mar 2015 10:13:58 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: robertkowalski@apache.org To: commits@couchdb.apache.org Date: Wed, 25 Mar 2015 10:14:07 -0000 Message-Id: <635858e952324afabbe9e56308058324@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [10/11] fauxton commit: updated refs/heads/master to 9343084 tooling: automatically test for code style Currently taking a look if our js coding guidelines are followed is done manually during the main code review of a PR. This takes a lot of time for the reviewer and often results in 1-2 more iterations until the patch is landed, just taking the style issues into account. Additionally there are sometimes so much style issues that it gets hard to focus on the real issues, e.g. the architecture of a patch or the overall implementation. This PR enables a precheck that allows to automatically detect if our styleguide was followed. The errors can now get cleaned up before the review, saving time of the reviewer and the submitter. As most style issues won't appear any more in a review the review focus will change to a discussion that is more related to the actual implementation, probably resulting in better reviews and overall code quality. PR: #326 PR-URL: https://github.com/apache/couchdb-fauxton/pull/326 Reviewed-By: garren smith Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/ae16ad93 Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/ae16ad93 Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/ae16ad93 Branch: refs/heads/master Commit: ae16ad93cfe5097b759655603c253e413ecfe6a6 Parents: c54822a Author: Robert Kowalski Authored: Sun Mar 22 22:20:21 2015 +0100 Committer: Robert Kowalski Committed: Wed Mar 25 11:12:02 2015 +0100 ---------------------------------------------------------------------- .jscsrc | 42 ++++++++++++++++++++++++++++++++++++++++++ package.json | 14 ++++++++------ 2 files changed, 50 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/ae16ad93/.jscsrc ---------------------------------------------------------------------- diff --git a/.jscsrc b/.jscsrc new file mode 100644 index 0000000..4a4ffbb --- /dev/null +++ b/.jscsrc @@ -0,0 +1,42 @@ +{ + "disallowEmptyBlocks": true, + "disallowKeywordsOnNewLine": ["else"], + "disallowTrailingWhitespace": true, + "validateIndentation": 2, + "fileExtensions": [".js", ".jsx"], + "excludeFiles": [ + "app/**/*.react.js", + "app/addons/.module-cache", + "app/addons/pouchdb/pouchdb.mapreduce.js", + "app/addons/pouchdb/pouch.collate.js", + "app/load_addons.js" + ], + "disallowMixedSpacesAndTabs": true, + "requireSpaceBeforeBinaryOperators": [ + "=", "+=", "-=", "*=", "/=", "%=", "<<=", ">>=", ">>>=", + "&=", "|=", "^=", "+=", + + "+", "-", "*", "/", "%", "<<", ">>", ">>>", "&", + "|", "^", "&&", "||", "===", "==", ">=", + "<=", "<", ">", "!=", "!==" + ], + "requireSpaceAfterBinaryOperators": true, + "requireSpacesInConditionalExpression": true, + "requireSpaceBeforeBlockStatements": true, + "requireLineFeedAtFileEnd": true, + "requireSpacesInFunctionExpression": { + "beforeOpeningCurlyBrace": true + }, + "requireSpaceAfterKeywords": [ + "if", + "else", + "for", + "while", + "do", + "switch", + "return", + "try", + "catch", + "function" + ] +} http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/ae16ad93/package.json ---------------------------------------------------------------------- diff --git a/package.json b/package.json index f1dc99c..3169bad 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "async": "~0.2.6", "couchapp": "~0.11.0", "grunt": "~0.4.1", + "grunt-chmod": "^1.0.3", "grunt-cli": "~0.1.6", "grunt-contrib-clean": "~0.4.1", "grunt-contrib-concat": "~0.3.0", @@ -24,20 +25,21 @@ "grunt-couchapp": "~0.2.1", "grunt-exec": "~0.4.0", "grunt-init": "~0.2.0", + "grunt-md5": "^0.1.11", + "grunt-mocha-phantomjs": "~0.3.0", "grunt-shell": "^1.1.1", "http-proxy": "~1.1.4", + "jsxcs": "~0.2.1", + "nano": "~5.12.0", + "nightwatch": "~0.5.33", "react-tools": "^0.12.0", "send": "~0.1.1", "underscore": "~1.4.2", "url": "~0.7.9", - "urls": "~0.0.3", - "grunt-mocha-phantomjs": "~0.3.0", - "nightwatch": "~0.5.33", - "nano": "~5.12.0", - "grunt-chmod": "^1.0.3", - "grunt-md5": "^0.1.11" + "urls": "~0.0.3" }, "scripts": { + "stylecheck": "jsxcs app && jsxcs test/nightwatch_tests && jsxcs tasks && jsxcs Gruntfile.js", "test": "grunt test", "couchdebug": "grunt couchdebug", "couchdb": "grunt couchdb"