diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4347e5e5a..2554c2209 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -122,7 +122,7 @@ To publish a release: This is script will: * Update README.md with correct cdn links -* Update CHANGLOG.md with the milestone description and a list of closed issues +* Update CHANGELOG.md with the milestone description and a list of closed issues * Commit the built files to the `release` branch * Publish the python version to PyPI * Publish the javascript version to npm diff --git a/js/src/cli.js b/js/src/cli.js index 452d56bd5..8650774b4 100755 --- a/js/src/cli.js +++ b/js/src/cli.js @@ -55,7 +55,7 @@ nopt.typeDefs.brace_style = { validate: function(data, key, val) { data[key] = val; // TODO: expand-strict is obsolete, now identical to expand. Remove in future version - // TODO: collapse-preserve-inline is obselete, now identical to collapse,preserve-inline = true. Remove in future version + // TODO: collapse-preserve-inline is obsolete, now identical to collapse,preserve-inline = true. Remove in future version var validVals = ["collapse", "collapse-preserve-inline", "expand", "end-expand", "expand-strict", "none", "preserve-inline"]; var valSplit = val.split(/[^a-zA-Z0-9_\-]+/); //Split will always return at least one parameter for (var i = 0; i < valSplit.length; i++) { @@ -709,4 +709,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/html/beautifier.js b/js/src/html/beautifier.js index f862beaa5..6ca6ab243 100644 --- a/js/src/html/beautifier.js +++ b/js/src/html/beautifier.js @@ -490,7 +490,7 @@ Beautifier.prototype._print_custom_beatifier_text = function(printer, raw_token, if (text) { if (_beautifier) { - // call the Beautifier if avaliable + // call the Beautifier if available var Child_options = function() { this.eol = '\n'; }; @@ -822,12 +822,12 @@ Beautifier.prototype._do_optional_end_element = function(parser_token) { } else if (parser_token.tag_name === 'colgroup') { // DONE: A colgroup element’s end tag may be omitted if the colgroup element is not immediately followed by a space character or a comment. - // A caption element's end tag may be ommitted if a colgroup, thead, tfoot, tbody, or tr element is started. + // A caption element's end tag may be omitted if a colgroup, thead, tfoot, tbody, or tr element is started. result = result || this._tag_stack.try_pop('caption', ['table']); } else if (parser_token.tag_name === 'thead') { - // A colgroup element's end tag may be ommitted if a thead, tfoot, tbody, or tr element is started. - // A caption element's end tag may be ommitted if a colgroup, thead, tfoot, tbody, or tr element is started. + // A colgroup element's end tag may be omitted if a thead, tfoot, tbody, or tr element is started. + // A caption element's end tag may be omitted if a colgroup, thead, tfoot, tbody, or tr element is started. result = result || this._tag_stack.try_pop('caption', ['table']); result = result || this._tag_stack.try_pop('colgroup', ['table']); @@ -837,8 +837,8 @@ Beautifier.prototype._do_optional_end_element = function(parser_token) { } else if (parser_token.tag_name === 'tbody' || parser_token.tag_name === 'tfoot') { // A thead element’s end tag may be omitted if the thead element is immediately followed by a tbody or tfoot element. // A tbody element’s end tag may be omitted if the tbody element is immediately followed by a tbody or tfoot element, or if there is no more content in the parent element. - // A colgroup element's end tag may be ommitted if a thead, tfoot, tbody, or tr element is started. - // A caption element's end tag may be ommitted if a colgroup, thead, tfoot, tbody, or tr element is started. + // A colgroup element's end tag may be omitted if a thead, tfoot, tbody, or tr element is started. + // A caption element's end tag may be omitted if a colgroup, thead, tfoot, tbody, or tr element is started. result = result || this._tag_stack.try_pop('caption', ['table']); result = result || this._tag_stack.try_pop('colgroup', ['table']); result = result || this._tag_stack.try_pop('thead', ['table']); @@ -849,8 +849,8 @@ Beautifier.prototype._do_optional_end_element = function(parser_token) { } else if (parser_token.tag_name === 'tr') { // A tr element’s end tag may be omitted if the tr element is immediately followed by another tr element, or if there is no more content in the parent element. - // A colgroup element's end tag may be ommitted if a thead, tfoot, tbody, or tr element is started. - // A caption element's end tag may be ommitted if a colgroup, thead, tfoot, tbody, or tr element is started. + // A colgroup element's end tag may be omitted if a thead, tfoot, tbody, or tr element is started. + // A caption element's end tag may be omitted if a colgroup, thead, tfoot, tbody, or tr element is started. result = result || this._tag_stack.try_pop('caption', ['table']); result = result || this._tag_stack.try_pop('colgroup', ['table']); result = result || this._tag_stack.try_pop('tr', ['table', 'thead', 'tbody', 'tfoot']); diff --git a/js/src/javascript/beautifier.js b/js/src/javascript/beautifier.js index 37350c225..159a4fca6 100644 --- a/js/src/javascript/beautifier.js +++ b/js/src/javascript/beautifier.js @@ -915,7 +915,7 @@ Beautifier.prototype.handle_word = function(current_token) { } else if (reserved_word(this._flags.last_token, 'default') && this._last_last_text === 'export') { this._output.space_before_token = true; } else if (this._flags.last_token.text === 'declare') { - // accomodates Typescript declare function formatting + // accommodates Typescript declare function formatting this._output.space_before_token = true; } else { this.print_newline(); @@ -1006,7 +1006,7 @@ Beautifier.prototype.handle_word = function(current_token) { // no newline between 'return nnn' this._output.space_before_token = true; } else if (this._flags.last_token.text === 'declare' && reserved_array(current_token, ['var', 'let', 'const'])) { - // accomodates Typescript declare formatting + // accommodates Typescript declare formatting this._output.space_before_token = true; } else if (this._flags.last_token.type !== TOKEN.END_EXPR) { if ((this._flags.last_token.type !== TOKEN.START_EXPR || !reserved_array(current_token, ['var', 'let', 'const'])) && this._flags.last_token.text !== ':') { @@ -1316,7 +1316,7 @@ Beautifier.prototype.handle_operator = function(current_token) { // a++ + ++b; // a - -b space_before = in_array(current_token.text, ['--', '-', '++', '+']) && in_array(this._flags.last_token.text, ['--', '-', '++', '+']); - // + and - are not unary when preceeded by -- or ++ operator + // + and - are not unary when proceeded by -- or ++ operator // a-- + b // a * +b // a - -b diff --git a/js/test/core/test_inputscanner.js b/js/test/core/test_inputscanner.js index 22a382780..b52d4fc0f 100644 --- a/js/test/core/test_inputscanner.js +++ b/js/test/core/test_inputscanner.js @@ -240,7 +240,7 @@ describe('IndexScanner', function() { assert.deepStrictEqual(inputText.get_regexp(pattern, matchFrom).toString(), '/ow/y'); }); - it('should return pattern with flags appeded when the input is not a string', function() { + it('should return pattern with flags appended when the input is not a string', function() { var inputText = new InputScanner("howdy"); var matchFrom = true; var pattern = /ow/; diff --git a/js/test/shell-test.sh b/js/test/shell-test.sh index 796a7b8a1..b2bcb1659 100755 --- a/js/test/shell-test.sh +++ b/js/test/shell-test.sh @@ -235,7 +235,7 @@ test_cli_js_beautify() cleanup 1 } - # TODO: EditorConfig setting should NOT overide cli setting, but that is + # TODO: EditorConfig setting should NOT override cli setting, but that is # the current by-design behavior, due to code limitations. # file input scenario @@ -243,7 +243,7 @@ test_cli_js_beautify() cd $TEST_TEMP/editorconfig || exit 1 $CLI_SCRIPT --end-with-newline --indent-size 6 --editorconfig -o example-${SCENARIO}.js example.js \ && diff -q example-${SCENARIO}.js example-ec.js || { - echo "EditorConfig setting should overide cli setting." + echo "EditorConfig setting should override cli setting." diff example-${SCENARIO}.js example-ec.js | cat -t -e cleanup 1 } @@ -251,7 +251,7 @@ test_cli_js_beautify() cd $TEST_TEMP/editorconfig/crlf || exit 1 $CLI_SCRIPT --end-with-newline --indent-size 6 --editorconfig -o example-${SCENARIO}.js example.js \ && diff -q example-${SCENARIO}.js example-ec.js || { - echo "EditorConfig setting should overide cli setting." + echo "EditorConfig setting should override cli setting." diff example-${SCENARIO}.js example-ec.js | cat -t -e cleanup 1 } @@ -259,7 +259,7 @@ test_cli_js_beautify() cd $TEST_TEMP/editorconfig/cr || exit 1 $CLI_SCRIPT --end-with-newline --indent-size 6 --editorconfig -o example-${SCENARIO}.js example.js \ && diff -q example-${SCENARIO}.js example-ec.js || { - echo "EditorConfig setting should overide cli setting." + echo "EditorConfig setting should override cli setting." diff example-${SCENARIO}.js example-ec.js | cat -t -e cleanup 1 } @@ -270,7 +270,7 @@ test_cli_js_beautify() echo "cat example.js | $CLI_SCRIPT --end-with-newline --indent-size 6 --editorconfig > example-${SCENARIO}.js" cat example.js | $CLI_SCRIPT --end-with-newline --indent-size 6 --editorconfig > example-${SCENARIO}.js \ && diff -q example-${SCENARIO}.js example-ec.js || { - echo "EditorConfig setting should overide cli setting." + echo "EditorConfig setting should override cli setting." diff example-${SCENARIO}.js example-ec.js | cat -t -e cleanup 1 } @@ -279,7 +279,7 @@ test_cli_js_beautify() echo "cat example.js | $CLI_SCRIPT --end-with-newline --indent-size 6 --editorconfig > example-${SCENARIO}.js" cat example.js | $CLI_SCRIPT --end-with-newline --indent-size 6 --editorconfig > example-${SCENARIO}.js \ && diff -q example-${SCENARIO}.js example-ec.js || { - echo "EditorConfig setting should overide cli setting." + echo "EditorConfig setting should override cli setting." diff example-${SCENARIO}.js example-ec.js | cat -t -e cleanup 1 } @@ -288,7 +288,7 @@ test_cli_js_beautify() echo "cat example.js | $CLI_SCRIPT --end-with-newline --indent-size 6 --editorconfig > example-${SCENARIO}.js" cat example.js | $CLI_SCRIPT --end-with-newline --indent-size 6 --editorconfig > example-${SCENARIO}.js \ && diff -q example-${SCENARIO}.js example-ec.js || { - echo "EditorConfig setting should overide cli setting." + echo "EditorConfig setting should override cli setting." diff example-${SCENARIO}.js example-ec.js | cat -t -e cleanup 1 } @@ -300,7 +300,7 @@ test_cli_js_beautify() echo "cat example.js | $CLI_SCRIPT --end-with-newline --indent-size 6 --editorconfig -o example-${SCENARIO}.js" cat example.js | $CLI_SCRIPT --end-with-newline --indent-size 6 --editorconfig -o example-${SCENARIO}.js - \ && diff -q example-${SCENARIO}.js example-ec.js || { - echo "EditorConfig setting should overide cli setting." + echo "EditorConfig setting should override cli setting." diff example-${SCENARIO}.js example-ec.js | cat -t -e cleanup 1 } @@ -308,7 +308,7 @@ test_cli_js_beautify() cd $TEST_TEMP/editorconfig/crlf || exit 1 cat example.js | $CLI_SCRIPT --end-with-newline --indent-size 6 --editorconfig -o example-${SCENARIO}.js - \ && diff -q example-${SCENARIO}.js example-ec.js || { - echo "EditorConfig setting should overide cli setting." + echo "EditorConfig setting should override cli setting." diff example-${SCENARIO}.js example-ec.js | cat -t -e cleanup 1 } @@ -316,7 +316,7 @@ test_cli_js_beautify() cd $TEST_TEMP/editorconfig/cr || exit 1 cat example.js | $CLI_SCRIPT --end-with-newline --indent-size 6 --editorconfig -o example-${SCENARIO}.js - \ && diff -q example-${SCENARIO}.js example-ec.js || { - echo "EditorConfig setting should overide cli setting." + echo "EditorConfig setting should override cli setting." diff example-${SCENARIO}.js example-ec.js | cat -t -e cleanup 1 } @@ -362,7 +362,7 @@ test_cli_js_beautify() cd $SCRIPT_DIR/resources/configerror $CLI_SCRIPT $TEST_TEMP/example1-default.js 2>&1 | grep -q "Error while loading beautifier configuration\." || { - echo "js-beautify output for $TEST_TEMP/example1-default.js was expected to be configration load error message." + echo "js-beautify output for $TEST_TEMP/example1-default.js was expected to be configuration load error message." cleanup 1 } diff --git a/python/cssbeautifier/css/beautifier.py b/python/cssbeautifier/css/beautifier.py index 28734c53d..ea768982c 100644 --- a/python/cssbeautifier/css/beautifier.py +++ b/python/cssbeautifier/css/beautifier.py @@ -294,7 +294,7 @@ def beautify(self): elif self._ch == "@": self.preserveSingleSpace(isAfterSpace) - # deal with less propery mixins @{...} + # deal with less property mixins @{...} if self._input.peek() == "{": self.print_string(self._ch + self.eatString("}")) else: diff --git a/python/jsbeautifier/javascript/beautifier.py b/python/jsbeautifier/javascript/beautifier.py index fff41a05f..f7f21560d 100644 --- a/python/jsbeautifier/javascript/beautifier.py +++ b/python/jsbeautifier/javascript/beautifier.py @@ -1015,7 +1015,7 @@ def handle_word(self, current_token): ): self._output.space_before_token = True elif self._flags.last_token.text == "declare": - # accomodates Typescript declare function formatting + # accommodates Typescript declare function formatting self._output.space_before_token = True else: self.print_newline() @@ -1132,7 +1132,7 @@ def handle_word(self, current_token): elif self._flags.last_token.text == "declare" and reserved_array( current_token, ["var", "let", "const"] ): - # accomodates Typescript declare formatting + # accommodates Typescript declare formatting self._output.space_before_token = True elif self._flags.last_token.type != TOKEN.END_EXPR: if ( @@ -1492,7 +1492,7 @@ def handle_operator(self, current_token): "++", "+", ] and self._flags.last_token.text in ["--", "-", "++", "+"] - # + and - are not unary when preceeded by -- or ++ operator + # + and - are not unary when proceeded by -- or ++ operator # a-- + b # a * +b # a - -b diff --git a/python/jsbeautifier/tests/shell-test.sh b/python/jsbeautifier/tests/shell-test.sh index a4d4bf82e..10bbd58d4 100755 --- a/python/jsbeautifier/tests/shell-test.sh +++ b/python/jsbeautifier/tests/shell-test.sh @@ -260,7 +260,7 @@ test_cli_js_beautify() cleanup 1 } - # TODO: EditorConfig setting should NOT overide cli setting, but that is + # TODO: EditorConfig setting should NOT override cli setting, but that is # the current by-design behavior, due to code limitations. # file input scenario @@ -268,7 +268,7 @@ test_cli_js_beautify() cd $TEST_TEMP/editorconfig || exit 1 $CLI_SCRIPT --end-with-newline --indent-size 6 --editorconfig -o example-${SCENARIO}.js example.js \ && diff -q example-${SCENARIO}.js example-ec.js || { - echo "EditorConfig setting should overide cli setting." + echo "EditorConfig setting should override cli setting." diff example-${SCENARIO}.js example-ec.js | cat -t -e cleanup 1 } @@ -276,7 +276,7 @@ test_cli_js_beautify() cd $TEST_TEMP/editorconfig/crlf || exit 1 $CLI_SCRIPT --end-with-newline --indent-size 6 --editorconfig -o example-${SCENARIO}.js example.js \ && diff -q example-${SCENARIO}.js example-ec.js || { - echo "EditorConfig setting should overide cli setting." + echo "EditorConfig setting should override cli setting." diff example-${SCENARIO}.js example-ec.js | cat -t -e cleanup 1 } @@ -284,7 +284,7 @@ test_cli_js_beautify() cd $TEST_TEMP/editorconfig/cr || exit 1 $CLI_SCRIPT --end-with-newline --indent-size 6 --editorconfig -o example-${SCENARIO}.js example.js \ && diff -q example-${SCENARIO}.js example-ec.js || { - echo "EditorConfig setting should overide cli setting." + echo "EditorConfig setting should override cli setting." diff example-${SCENARIO}.js example-ec.js | cat -t -e cleanup 1 } @@ -295,7 +295,7 @@ test_cli_js_beautify() echo "cat example.js | $CLI_SCRIPT --end-with-newline --indent-size 6 --editorconfig > example-${SCENARIO}.js" cat example.js | $CLI_SCRIPT --end-with-newline --indent-size 6 --editorconfig > example-${SCENARIO}.js \ && diff -q example-${SCENARIO}.js example-ec.js || { - echo "EditorConfig setting should overide cli setting." + echo "EditorConfig setting should override cli setting." diff example-${SCENARIO}.js example-ec.js | cat -t -e cleanup 1 } @@ -304,7 +304,7 @@ test_cli_js_beautify() echo "cat example.js | $CLI_SCRIPT --end-with-newline --indent-size 6 --editorconfig > example-${SCENARIO}.js" cat example.js | $CLI_SCRIPT --end-with-newline --indent-size 6 --editorconfig > example-${SCENARIO}.js \ && diff -q example-${SCENARIO}.js example-ec.js || { - echo "EditorConfig setting should overide cli setting." + echo "EditorConfig setting should override cli setting." diff example-${SCENARIO}.js example-ec.js | cat -t -e cleanup 1 } @@ -313,7 +313,7 @@ test_cli_js_beautify() echo "cat example.js | $CLI_SCRIPT --end-with-newline --indent-size 6 --editorconfig > example-${SCENARIO}.js" cat example.js | $CLI_SCRIPT --end-with-newline --indent-size 6 --editorconfig > example-${SCENARIO}.js \ && diff -q example-${SCENARIO}.js example-ec.js || { - echo "EditorConfig setting should overide cli setting." + echo "EditorConfig setting should override cli setting." diff example-${SCENARIO}.js example-ec.js | cat -t -e cleanup 1 } @@ -325,7 +325,7 @@ test_cli_js_beautify() echo "cat example.js | $CLI_SCRIPT --end-with-newline --indent-size 6 --editorconfig -o example-${SCENARIO}.js" cat example.js | $CLI_SCRIPT --end-with-newline --indent-size 6 --editorconfig -o example-${SCENARIO}.js - \ && diff -q example-${SCENARIO}.js example-ec.js || { - echo "EditorConfig setting should overide cli setting." + echo "EditorConfig setting should override cli setting." diff example-${SCENARIO}.js example-ec.js | cat -t -e cleanup 1 } @@ -333,7 +333,7 @@ test_cli_js_beautify() cd $TEST_TEMP/editorconfig/crlf || exit 1 cat example.js | $CLI_SCRIPT --end-with-newline --indent-size 6 --editorconfig -o example-${SCENARIO}.js - \ && diff -q example-${SCENARIO}.js example-ec.js || { - echo "EditorConfig setting should overide cli setting." + echo "EditorConfig setting should override cli setting." diff example-${SCENARIO}.js example-ec.js | cat -t -e cleanup 1 } @@ -341,7 +341,7 @@ test_cli_js_beautify() cd $TEST_TEMP/editorconfig/cr || exit 1 cat example.js | $CLI_SCRIPT --end-with-newline --indent-size 6 --editorconfig -o example-${SCENARIO}.js - \ && diff -q example-${SCENARIO}.js example-ec.js || { - echo "EditorConfig setting should overide cli setting." + echo "EditorConfig setting should override cli setting." diff example-${SCENARIO}.js example-ec.js | cat -t -e cleanup 1 } diff --git a/test/data/css/tests.js b/test/data/css/tests.js index ce5965d1c..1a8bc17cc 100644 --- a/test/data/css/tests.js +++ b/test/data/css/tests.js @@ -1479,7 +1479,7 @@ exports.test_data = { } ] }, { - name: "Regresssion Tests", + name: "Regression Tests", description: "General Regression tests for known issues", options: [{ name: "selector_separator_newline", value: "false" }], tests: [{ diff --git a/test/data/html/tests.js b/test/data/html/tests.js index 6d37e432e..2644c41bb 100644 --- a/test/data/html/tests.js +++ b/test/data/html/tests.js @@ -263,7 +263,7 @@ exports.test_data = { }] }, { name: "Tests for script and style Commented and cdata wapping (#1641)", - description: "Repect comment and cdata wrapping regardless of beautifier", + description: "Respect comment and cdata wrapping regardless of beautifier", options: [ { name: "templating", value: "'php'" } ], diff --git a/test/data/javascript/tests.js b/test/data/javascript/tests.js index dd0f31690..36ad9f177 100644 --- a/test/data/javascript/tests.js +++ b/test/data/javascript/tests.js @@ -3851,7 +3851,7 @@ exports.test_data = { unchanged: [ 'a = {', ' get b() {', - ' retun 0;', + ' return 0;', ' },', ' c: 1,', ' d: function() {}', @@ -3859,7 +3859,7 @@ exports.test_data = { ] }, { - comment: "Issue 298 - do not under indent if/while/for condtionals experesions", + comment: "Issue 298 - do not under indent if/while/for conditionals expressions", unchanged: [ '\\\'use strict\\\';', 'if ([].some(function() {', @@ -3870,7 +3870,7 @@ exports.test_data = { ] }, { - comment: "Issue 298 - do not under indent if/while/for condtionals experesions", + comment: "Issue 298 - do not under indent if/while/for conditionals expressions", unchanged: [ '\\\'use strict\\\';', 'if ([].some(function() {', diff --git a/tools/build.sh b/tools/build.sh index 045f02705..7ffa107f8 100755 --- a/tools/build.sh +++ b/tools/build.sh @@ -20,7 +20,7 @@ build_js() cp ./js/src/cli.js ./js/lib/ # Wrap webkit output into an non-breaking form. - # In an upcoming verion these will be replaced with standard webpack umd + # In an upcoming version these will be replaced with standard webpack umd sed '/GENERATED_BUILD_OUTPUT/ r ./build/legacy/legacy_beautify_js.js' <./tools/template/beautify.wrapper.js >./js/lib/beautify.js || exit 1 sed '/GENERATED_BUILD_OUTPUT/ r ./build/legacy/legacy_beautify_css.js' <./tools/template/beautify-css.wrapper.js >./js/lib/beautify-css.js || exit 1 sed '/GENERATED_BUILD_OUTPUT/ r ./build/legacy/legacy_beautify_html.js' <./tools/template/beautify-html.wrapper.js >./js/lib/beautify-html.js || exit 1 diff --git a/web/common-function.js b/web/common-function.js index 2259636a9..a7fdc9633 100644 --- a/web/common-function.js +++ b/web/common-function.js @@ -268,11 +268,11 @@ function submitIssue() { window.open(url, '_blank').focus(); } -function getSubmitIssueBody(trucate) { +function getSubmitIssueBody(truncate) { var input = the.lastInput; var output = the.lastOutput; - if (trucate) { + if (truncate) { input = '/* Your input text */'; output = '/* Output text currently returned by the beautifier */'; }