From c0a1ff0b325e1c6e434f3747463ef863a6ddeb8c Mon Sep 17 00:00:00 2001 From: Yury Delendik Date: Fri, 19 May 2017 07:53:34 -0500 Subject: [PATCH] Removes CRLF checker --- external/crlfchecker/crlfchecker.js | 23 ---------------------- external/crlfchecker/normtext.js | 30 ----------------------------- 2 files changed, 53 deletions(-) delete mode 100644 external/crlfchecker/crlfchecker.js delete mode 100644 external/crlfchecker/normtext.js diff --git a/external/crlfchecker/crlfchecker.js b/external/crlfchecker/crlfchecker.js deleted file mode 100644 index c136af3bd..000000000 --- a/external/crlfchecker/crlfchecker.js +++ /dev/null @@ -1,23 +0,0 @@ -'use strict'; - -function checkIfCrlfIsPresent(files) { - var failed = []; - - (ls(files)).forEach(function checkCrlf(file) { - if ((cat(file)).match(/.*\r.*/)) { - failed.push(file); - } - }); - - if (failed.length) { - var errorMessage = - 'Please remove carriage return\'s from\n' + failed.join('\n') + '\n' + - 'Also check your setting for: git config core.autocrlf.'; - - echo(); - echo(errorMessage); - exit(1); - } -} - -exports.checkIfCrlfIsPresent = checkIfCrlfIsPresent; diff --git a/external/crlfchecker/normtext.js b/external/crlfchecker/normtext.js deleted file mode 100644 index bbcd6e89a..000000000 --- a/external/crlfchecker/normtext.js +++ /dev/null @@ -1,30 +0,0 @@ -/* Copyright 2012 Mozilla Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -'use strict'; - -var fs = require('fs'); - -function normalizeText(s) { - return s.replace(/\r\n?/g, '\n').replace(/\uFEFF/g, ''); -} - -var args = process.argv.slice(2); - -args.forEach(function (file) { - var content = fs.readFileSync(file, 'utf8'); - content = normalizeText(content); - fs.writeFileSync(file, content, 'utf8'); -});