From ab85ff6554dd95a971a8c82a3e7687d7a8525acb Mon Sep 17 00:00:00 2001 From: Liam Newman Date: Mon, 8 Oct 2018 10:10:39 -0700 Subject: [PATCH] Added newlines to end of files --- index.html | 2 +- js/src/cli.js | 2 +- js/src/core/directives.js | 2 +- js/src/core/inputscanner.js | 2 +- js/src/core/options.js | 2 +- js/src/core/output.js | 2 +- js/src/core/token.js | 2 +- js/src/core/tokenizer.js | 2 +- js/src/core/tokenstream.js | 2 +- js/src/css/beautifier.js | 2 +- js/src/css/index.js | 2 +- js/src/css/options.js | 2 +- js/src/css/tokenizer.js | 2 +- js/src/html/beautifier.js | 2 +- js/src/html/index.js | 2 +- js/src/html/options.js | 2 +- js/src/html/tokenizer.js | 2 +- js/src/index.js | 2 +- js/src/javascript/acorn.js | 2 +- js/src/javascript/beautifier.js | 2 +- js/src/javascript/index.js | 2 +- js/src/javascript/options.js | 2 +- js/src/javascript/tokenizer.js | 2 +- js/src/unpackers/javascriptobfuscator_unpacker.js | 2 +- js/src/unpackers/myobfuscate_unpacker.js | 2 +- js/src/unpackers/p_a_c_k_e_r_unpacker.js | 2 +- js/src/unpackers/urlencode_unpacker.js | 2 +- js/test/amd-beautify-tests.js | 2 +- js/test/core/test_inputscanner.js | 2 +- js/test/node-beautify-css-perf-tests.js | 2 +- js/test/node-beautify-html-perf-tests.js | 2 +- js/test/node-beautify-perf-tests.js | 2 +- js/test/node-beautify-tests.js | 2 +- js/test/node-src-index-tests.js | 2 +- js/test/sanitytest.js | 2 +- jsbeautifyrc | 1 + test/data/css/tests.js | 2 +- test/data/html/tests.js | 2 +- test/data/javascript/inputlib.js | 2 +- test/data/javascript/tests.js | 2 +- web/common-function.js | 2 +- web/common-style.css | 2 +- web/google-analytics.js | 2 +- web/onload.js | 2 +- 44 files changed, 44 insertions(+), 43 deletions(-) diff --git a/index.html b/index.html index e3c48b02..f81482d1 100644 --- a/index.html +++ b/index.html @@ -276,4 +276,4 @@ - \ No newline at end of file + diff --git a/js/src/cli.js b/js/src/cli.js index 27ec05f7..298a0951 100755 --- a/js/src/cli.js +++ b/js/src/cli.js @@ -639,4 +639,4 @@ function logToStdout(str, config) { if (typeof config.quiet === "undefined" || !config.quiet) { console.log(str); } -} \ No newline at end of file +} diff --git a/js/src/core/directives.js b/js/src/core/directives.js index 22db1b32..f61e6214 100644 --- a/js/src/core/directives.js +++ b/js/src/core/directives.js @@ -59,4 +59,4 @@ Directives.prototype.readIgnored = function(input) { }; -module.exports.Directives = Directives; \ No newline at end of file +module.exports.Directives = Directives; diff --git a/js/src/core/inputscanner.js b/js/src/core/inputscanner.js index 500dd9f4..8111b6b3 100644 --- a/js/src/core/inputscanner.js +++ b/js/src/core/inputscanner.js @@ -145,4 +145,4 @@ InputScanner.prototype.lookBack = function(testVal) { }; -module.exports.InputScanner = InputScanner; \ No newline at end of file +module.exports.InputScanner = InputScanner; diff --git a/js/src/core/options.js b/js/src/core/options.js index 2bd44ceb..62b64450 100644 --- a/js/src/core/options.js +++ b/js/src/core/options.js @@ -175,4 +175,4 @@ function _normalizeOpts(options) { module.exports.Options = Options; module.exports.normalizeOpts = _normalizeOpts; -module.exports.mergeOpts = _mergeOpts; \ No newline at end of file +module.exports.mergeOpts = _mergeOpts; diff --git a/js/src/core/output.js b/js/src/core/output.js index 59ff1efd..5e400ffb 100644 --- a/js/src/core/output.js +++ b/js/src/core/output.js @@ -306,4 +306,4 @@ Output.prototype.ensure_empty_line_above = function(starts_with, ends_with) { } }; -module.exports.Output = Output; \ No newline at end of file +module.exports.Output = Output; diff --git a/js/src/core/token.js b/js/src/core/token.js index 3ccd0c33..13f6e901 100644 --- a/js/src/core/token.js +++ b/js/src/core/token.js @@ -51,4 +51,4 @@ function Token(type, text, newlines, whitespace_before) { } -module.exports.Token = Token; \ No newline at end of file +module.exports.Token = Token; diff --git a/js/src/core/tokenizer.js b/js/src/core/tokenizer.js index 4c50d862..e2770348 100644 --- a/js/src/core/tokenizer.js +++ b/js/src/core/tokenizer.js @@ -149,4 +149,4 @@ Tokenizer.prototype._readWhitespace = function() { module.exports.Tokenizer = Tokenizer; -module.exports.TOKEN = TOKEN; \ No newline at end of file +module.exports.TOKEN = TOKEN; diff --git a/js/src/core/tokenstream.js b/js/src/core/tokenstream.js index 4ec3df6d..88302ffe 100644 --- a/js/src/core/tokenstream.js +++ b/js/src/core/tokenstream.js @@ -75,4 +75,4 @@ TokenStream.prototype.add = function(token) { this.__tokens_length += 1; }; -module.exports.TokenStream = TokenStream; \ No newline at end of file +module.exports.TokenStream = TokenStream; diff --git a/js/src/css/beautifier.js b/js/src/css/beautifier.js index e51ff62d..235fbecf 100644 --- a/js/src/css/beautifier.js +++ b/js/src/css/beautifier.js @@ -435,4 +435,4 @@ Beautifier.prototype.beautify = function() { return sweetCode; }; -module.exports.Beautifier = Beautifier; \ No newline at end of file +module.exports.Beautifier = Beautifier; diff --git a/js/src/css/index.js b/js/src/css/index.js index 5b640297..e59c070d 100644 --- a/js/src/css/index.js +++ b/js/src/css/index.js @@ -35,4 +35,4 @@ function css_beautify(source_text, options) { return beautifier.beautify(); } -module.exports = css_beautify; \ No newline at end of file +module.exports = css_beautify; diff --git a/js/src/css/options.js b/js/src/css/options.js index d69a9d9b..862769eb 100644 --- a/js/src/css/options.js +++ b/js/src/css/options.js @@ -43,4 +43,4 @@ Options.prototype = new BaseOptions(); -module.exports.Options = Options; \ No newline at end of file +module.exports.Options = Options; diff --git a/js/src/css/tokenizer.js b/js/src/css/tokenizer.js index 846efe5a..648ca950 100644 --- a/js/src/css/tokenizer.js +++ b/js/src/css/tokenizer.js @@ -26,4 +26,4 @@ SOFTWARE. */ -'use strict'; \ No newline at end of file +'use strict'; diff --git a/js/src/html/beautifier.js b/js/src/html/beautifier.js index a15a1cd9..f260e99b 100644 --- a/js/src/html/beautifier.js +++ b/js/src/html/beautifier.js @@ -740,4 +740,4 @@ Beautifier.prototype._do_optional_end_element = function(parser_token) { }; -module.exports.Beautifier = Beautifier; \ No newline at end of file +module.exports.Beautifier = Beautifier; diff --git a/js/src/html/index.js b/js/src/html/index.js index 0d299691..667c03c0 100644 --- a/js/src/html/index.js +++ b/js/src/html/index.js @@ -35,4 +35,4 @@ function style_html(html_source, options, js_beautify, css_beautify) { return beautifier.beautify(); } -module.exports = style_html; \ No newline at end of file +module.exports = style_html; diff --git a/js/src/html/options.js b/js/src/html/options.js index d541da84..64413cb8 100644 --- a/js/src/html/options.js +++ b/js/src/html/options.js @@ -79,4 +79,4 @@ Options.prototype = new BaseOptions(); -module.exports.Options = Options; \ No newline at end of file +module.exports.Options = Options; diff --git a/js/src/html/tokenizer.js b/js/src/html/tokenizer.js index 792f6a42..8fd9195b 100644 --- a/js/src/html/tokenizer.js +++ b/js/src/html/tokenizer.js @@ -285,4 +285,4 @@ Tokenizer.prototype._read_content_word = function() { }; module.exports.Tokenizer = Tokenizer; -module.exports.TOKEN = TOKEN; \ No newline at end of file +module.exports.TOKEN = TOKEN; diff --git a/js/src/index.js b/js/src/index.js index 2cba1a63..2d5bbe1c 100644 --- a/js/src/index.js +++ b/js/src/index.js @@ -40,4 +40,4 @@ function style_html(html_source, options, js, css) { module.exports.js = js_beautify; module.exports.css = css_beautify; -module.exports.html = style_html; \ No newline at end of file +module.exports.html = style_html; diff --git a/js/src/javascript/acorn.js b/js/src/javascript/acorn.js index e8b158fc..c77a47ed 100644 --- a/js/src/javascript/acorn.js +++ b/js/src/javascript/acorn.js @@ -53,4 +53,4 @@ exports.newline = /[\n\r\u2028\u2029]/; // in javascript, these two differ // in python they are the same, different methods are called on them exports.lineBreak = new RegExp('\r\n|' + exports.newline.source); -exports.allLineBreaks = new RegExp(exports.lineBreak.source, 'g'); \ No newline at end of file +exports.allLineBreaks = new RegExp(exports.lineBreak.source, 'g'); diff --git a/js/src/javascript/beautifier.js b/js/src/javascript/beautifier.js index 2f96ffa8..d2a2111b 100644 --- a/js/src/javascript/beautifier.js +++ b/js/src/javascript/beautifier.js @@ -1407,4 +1407,4 @@ Beautifier.prototype.handle_eof = function(current_token) { this.handle_whitespace_and_comments(current_token); }; -module.exports.Beautifier = Beautifier; \ No newline at end of file +module.exports.Beautifier = Beautifier; diff --git a/js/src/javascript/index.js b/js/src/javascript/index.js index 835dc5cf..d6f14c04 100644 --- a/js/src/javascript/index.js +++ b/js/src/javascript/index.js @@ -35,4 +35,4 @@ function js_beautify(js_source_text, options) { return beautifier.beautify(); } -module.exports = js_beautify; \ No newline at end of file +module.exports = js_beautify; diff --git a/js/src/javascript/options.js b/js/src/javascript/options.js index cef1d934..1234f239 100644 --- a/js/src/javascript/options.js +++ b/js/src/javascript/options.js @@ -90,4 +90,4 @@ Options.prototype = new BaseOptions(); -module.exports.Options = Options; \ No newline at end of file +module.exports.Options = Options; diff --git a/js/src/javascript/tokenizer.js b/js/src/javascript/tokenizer.js index d4e32354..23f2eff2 100644 --- a/js/src/javascript/tokenizer.js +++ b/js/src/javascript/tokenizer.js @@ -538,4 +538,4 @@ Tokenizer.prototype._read_string_recursive = function(delimiter, allow_unescaped module.exports.Tokenizer = Tokenizer; module.exports.TOKEN = TOKEN; module.exports.positionable_operators = positionable_operators.slice(); -module.exports.line_starters = line_starters.slice(); \ No newline at end of file +module.exports.line_starters = line_starters.slice(); diff --git a/js/src/unpackers/javascriptobfuscator_unpacker.js b/js/src/unpackers/javascriptobfuscator_unpacker.js index 359c15d0..c18794cd 100644 --- a/js/src/unpackers/javascriptobfuscator_unpacker.js +++ b/js/src/unpackers/javascriptobfuscator_unpacker.js @@ -129,4 +129,4 @@ var JavascriptObfuscator = { } -}; \ No newline at end of file +}; diff --git a/js/src/unpackers/myobfuscate_unpacker.js b/js/src/unpackers/myobfuscate_unpacker.js index 09063eb5..0e028ed9 100644 --- a/js/src/unpackers/myobfuscate_unpacker.js +++ b/js/src/unpackers/myobfuscate_unpacker.js @@ -116,4 +116,4 @@ var MyObfuscate = { } -}; \ No newline at end of file +}; diff --git a/js/src/unpackers/p_a_c_k_e_r_unpacker.js b/js/src/unpackers/p_a_c_k_e_r_unpacker.js index 39fb1647..a7421674 100644 --- a/js/src/unpackers/p_a_c_k_e_r_unpacker.js +++ b/js/src/unpackers/p_a_c_k_e_r_unpacker.js @@ -108,4 +108,4 @@ var P_A_C_K_E_R = { } -}; \ No newline at end of file +}; diff --git a/js/src/unpackers/urlencode_unpacker.js b/js/src/unpackers/urlencode_unpacker.js index 19da934d..0f7a9a29 100644 --- a/js/src/unpackers/urlencode_unpacker.js +++ b/js/src/unpackers/urlencode_unpacker.js @@ -101,4 +101,4 @@ var Urlencoded = { if (isNode) { module.exports = Urlencoded; -} \ No newline at end of file +} diff --git a/js/test/amd-beautify-tests.js b/js/test/amd-beautify-tests.js index 8cbd2a4e..585bd18d 100755 --- a/js/test/amd-beautify-tests.js +++ b/js/test/amd-beautify-tests.js @@ -62,4 +62,4 @@ if (require.main === module) { exit = exit || amd_beautifier_index_tests('html-beautifier', run_html_tests); process.exit(exit); -} \ No newline at end of file +} diff --git a/js/test/core/test_inputscanner.js b/js/test/core/test_inputscanner.js index 08346183..110afb32 100644 --- a/js/test/core/test_inputscanner.js +++ b/js/test/core/test_inputscanner.js @@ -63,4 +63,4 @@ describe('IndexScanner', function() { }); -}); \ No newline at end of file +}); diff --git a/js/test/node-beautify-css-perf-tests.js b/js/test/node-beautify-css-perf-tests.js index 0dbf3676..8797b7b5 100644 --- a/js/test/node-beautify-css-perf-tests.js +++ b/js/test/node-beautify-css-perf-tests.js @@ -42,4 +42,4 @@ function node_beautifier_html_tests() { if (require.main === module) { process.exit(node_beautifier_html_tests()); -} \ No newline at end of file +} diff --git a/js/test/node-beautify-html-perf-tests.js b/js/test/node-beautify-html-perf-tests.js index 1aeca3ae..cb17672a 100644 --- a/js/test/node-beautify-html-perf-tests.js +++ b/js/test/node-beautify-html-perf-tests.js @@ -51,4 +51,4 @@ function node_beautifier_html_tests() { if (require.main === module) { process.exit(node_beautifier_html_tests()); -} \ No newline at end of file +} diff --git a/js/test/node-beautify-perf-tests.js b/js/test/node-beautify-perf-tests.js index eb5fa898..aec8a3db 100644 --- a/js/test/node-beautify-perf-tests.js +++ b/js/test/node-beautify-perf-tests.js @@ -51,4 +51,4 @@ function node_beautifier_tests() { if (require.main === module) { process.exit(node_beautifier_tests()); -} \ No newline at end of file +} diff --git a/js/test/node-beautify-tests.js b/js/test/node-beautify-tests.js index f28f7e0c..9d633dd3 100755 --- a/js/test/node-beautify-tests.js +++ b/js/test/node-beautify-tests.js @@ -70,4 +70,4 @@ if (require.main === module) { exit = exit || node_beautifier_bundle_tests('html-beautifier', run_html_tests); process.exit(exit); -} \ No newline at end of file +} diff --git a/js/test/node-src-index-tests.js b/js/test/node-src-index-tests.js index 840d5932..82bfeb4a 100755 --- a/js/test/node-src-index-tests.js +++ b/js/test/node-src-index-tests.js @@ -47,4 +47,4 @@ if (require.main === module) { exit = exit || node_beautifier_index_tests('html-beautifier', run_html_tests); process.exit(exit); -} \ No newline at end of file +} diff --git a/js/test/sanitytest.js b/js/test/sanitytest.js index 891ac004..d41a32d7 100644 --- a/js/test/sanitytest.js +++ b/js/test/sanitytest.js @@ -143,4 +143,4 @@ function SanityTest(func, name_of_test) { if (typeof module !== 'undefined' && module.exports) { module.exports = SanityTest; -} \ No newline at end of file +} diff --git a/jsbeautifyrc b/jsbeautifyrc index 00bcf8a3..9acbc5e2 100644 --- a/jsbeautifyrc +++ b/jsbeautifyrc @@ -2,6 +2,7 @@ "indent_size": 2, "indent_char": " ", "indent_level": 0, + "end-with-newline": true, "indent_with_tabs": false, "preserve_newlines": true, "max_preserve_newlines": 10, diff --git a/test/data/css/tests.js b/test/data/css/tests.js index bd681d56..ffd177bf 100644 --- a/test/data/css/tests.js +++ b/test/data/css/tests.js @@ -1167,4 +1167,4 @@ exports.test_data = { } ] -}; \ No newline at end of file +}; diff --git a/test/data/html/tests.js b/test/data/html/tests.js index 90a1e50b..018cf4cf 100644 --- a/test/data/html/tests.js +++ b/test/data/html/tests.js @@ -2509,4 +2509,4 @@ exports.test_data = { }, { name: "New Test Suite" }] -}; \ No newline at end of file +}; diff --git a/test/data/javascript/inputlib.js b/test/data/javascript/inputlib.js index 4fd46914..432fc7d8 100644 --- a/test/data/javascript/inputlib.js +++ b/test/data/javascript/inputlib.js @@ -81,4 +81,4 @@ var operator_position = { module.exports = { operator_position: operator_position -}; \ No newline at end of file +}; diff --git a/test/data/javascript/tests.js b/test/data/javascript/tests.js index ed5fad85..67fe30e8 100644 --- a/test/data/javascript/tests.js +++ b/test/data/javascript/tests.js @@ -3561,4 +3561,4 @@ exports.test_data = { output: "" //string or array of lines }] }] -}; \ No newline at end of file +}; diff --git a/web/common-function.js b/web/common-function.js index fe276968..7a97eb95 100644 --- a/web/common-function.js +++ b/web/common-function.js @@ -276,4 +276,4 @@ function submitIssue() { console.log(url); window.open(url, '_blank').focus(); -} \ No newline at end of file +} diff --git a/web/common-style.css b/web/common-style.css index 58a089a0..632c6c4f 100644 --- a/web/common-style.css +++ b/web/common-style.css @@ -114,4 +114,4 @@ h2 { margin-bottom: 0; font-size: 20px; font-weight: normal; -} \ No newline at end of file +} diff --git a/web/google-analytics.js b/web/google-analytics.js index 99d88c3c..a7ace3ec 100644 --- a/web/google-analytics.js +++ b/web/google-analytics.js @@ -7,4 +7,4 @@ var _gaq = [ s = d.getElementsByTagName(t)[0]; g.src = '//www.google-analytics.com/ga.js'; s.parentNode.insertBefore(g, s); -}(document, 'script')); \ No newline at end of file +}(document, 'script')); diff --git a/web/onload.js b/web/onload.js index d32d7cec..d67f0c3b 100644 --- a/web/onload.js +++ b/web/onload.js @@ -49,4 +49,4 @@ $(function() { $('#additional-options').change(beautify); -}); \ No newline at end of file +});