From e997cdd812484aac51b5a0d571f329b96afc1589 Mon Sep 17 00:00:00 2001 From: Ben Limmer Date: Sun, 16 Oct 2016 11:39:12 -0600 Subject: [PATCH 1/2] Allow ignoring warnings from configuration. --- bin/eslint.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bin/eslint.js b/bin/eslint.js index 50e46abc3..cb465a76a 100755 --- a/bin/eslint.js +++ b/bin/eslint.js @@ -18,6 +18,8 @@ var glob = require("glob"); var options = { extensions: [".js"], ignore: true, reset: false, useEslintrc: true }; var cli; // instantiation delayed until after options are (potentially) modified var debug = false; +var ignoreWarnings = false; +var ESLINT_WARNING_SEVERITY = 1; var checks = require("../lib/checks"); var validateConfig = require("../lib/validate_config"); var computeFingerprint = require("../lib/compute_fingerprint"); @@ -174,6 +176,10 @@ runWithTiming("engineConfig", function () { options.ignorePath = userConfig.ignore_path; } + if (userConfig.ignore_warnings) { + ignoreWarnings = true; + } + if (userConfig.debug) { debug = true; } @@ -209,6 +215,8 @@ function analyzeFiles() { var path = result.filePath.replace(/^\/code\//, ""); result.messages.forEach(function(message) { + if (ignoreWarnings && message.severity === ESLINT_WARNING_SEVERITY) { return; } + var issueJson = buildIssueJson(message, path); process.stdout.write(issueJson + "\u0000\n"); }); From 05e63bb1b0a656dccf98fe9ca5f7a80f76f88e37 Mon Sep 17 00:00:00 2001 From: Ben Limmer Date: Sun, 23 Oct 2016 09:26:07 -0600 Subject: [PATCH 2/2] Add CONTRIBUTING.md. The file, for now, shows how to create a local engine image for testing. --- CONTRIBUTING.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000..f17419b88 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,19 @@ +# Contributing + +## Testing Changes +Changes made to the engine can be tested locally. + +1. Install [the CodeClimate CLI](https://github.com/codeclimate/codeclimate). +1. Create the image (customizing the `IMAGE_NAME` as needed): +```bash +IMAGE_NAME=codeclimate/codeclimate-eslint-test make image +``` +1. Add the engine to your test `.codeclimate.yml`: +```bash +eslint-test: + enabled: true +``` +1. Run analyze via the CLI: +```bash +codeclimate analyze --dev +```