Merge pull request #1644 from UziTech/patch-1

fix `undefined` when options has no description
This commit is contained in:
Glavin Wiechert 2017-05-06 16:37:12 -03:00 committed by GitHub
commit 5d2e707434
3 changed files with 12 additions and 12 deletions

View File

@ -7074,7 +7074,7 @@ Automatically beautify LaTeX files on save
**Description**: **Description**:
undefined (Supported by Latex Beautify) (Supported by Latex Beautify)
**Example `.jsbeautifyrc` Configuration** **Example `.jsbeautifyrc` Configuration**
@ -8945,7 +8945,7 @@ Automatically beautify Nginx files on save
**Description**: **Description**:
undefined (Supported by Nginx Beautify) (Supported by Nginx Beautify)
**Example `.jsbeautifyrc` Configuration** **Example `.jsbeautifyrc` Configuration**
@ -9706,7 +9706,7 @@ Absolute path to the `php-cs-fixer` CLI executable (Supported by PHP-CS-Fixer)
**Description**: **Description**:
undefined (Supported by PHP-CS-Fixer) (Supported by PHP-CS-Fixer)
**Example `.jsbeautifyrc` Configuration** **Example `.jsbeautifyrc` Configuration**
@ -16757,7 +16757,7 @@ Remove trailing whitespace (Supported by Latex Beautify)
**Description**: **Description**:
undefined (Supported by Latex Beautify) (Supported by Latex Beautify)
**Example `.jsbeautifyrc` Configuration** **Example `.jsbeautifyrc` Configuration**
@ -17311,7 +17311,7 @@ Indentation uses tabs, overrides `Indent Size` and `Indent Char` (Supported by N
**Description**: **Description**:
undefined (Supported by Nginx Beautify) (Supported by Nginx Beautify)
**Example `.jsbeautifyrc` Configuration** **Example `.jsbeautifyrc` Configuration**
@ -17366,7 +17366,7 @@ Absolute path to the `php-cs-fixer` CLI executable (Supported by PHP-CS-Fixer)
**Description**: **Description**:
undefined (Supported by PHP-CS-Fixer) (Supported by PHP-CS-Fixer)
**Example `.jsbeautifyrc` Configuration** **Example `.jsbeautifyrc` Configuration**

View File

@ -133,9 +133,9 @@ buildOptionsForBeautifiers = function(beautifiers, allLanguages) {
return _.reduce(languageOptions, (function(result, optionDef, optionName) { return _.reduce(languageOptions, (function(result, optionDef, optionName) {
optionDef.beautifiers = _.uniq(optionDef.beautifiers) optionDef.beautifiers = _.uniq(optionDef.beautifiers)
if (optionDef.beautifiers.length > 0) { if (optionDef.beautifiers.length > 0) {
optionDef.description = optionDef.description + " (Supported by " + (optionDef.beautifiers.join(', ')) + ")"; optionDef.description = (optionDef.description || "") + " (Supported by " + (optionDef.beautifiers.join(', ')) + ")";
} else { } else {
optionDef.description = optionDef.description + " (Not supported by any beautifiers)"; optionDef.description = (optionDef.description || "") + " (Not supported by any beautifiers)";
} }
if (result[optionName] != null) { if (result[optionName] != null) {
logger.warn("Duplicate option detected: ", optionName, optionDef); logger.warn("Duplicate option detected: ", optionName, optionDef);
@ -322,7 +322,7 @@ buildOptionsForBeautifiers = function(beautifiers, allLanguages) {
optionDef = ref16[o]; optionDef = ref16[o];
optionDef.beautifiers = _.uniq(optionDef.beautifiers) optionDef.beautifiers = _.uniq(optionDef.beautifiers)
if (optionDef.beautifiers.length > 0) { if (optionDef.beautifiers.length > 0) {
optionDef.description = optionDef.description + " (Supported by " + (optionDef.beautifiers.join(', ')) + ")"; optionDef.description = (optionDef.description || "") + " (Supported by " + (optionDef.beautifiers.join(', ')) + ")";
} else { } else {
unsupportedOptions.push(g + ".properties." + o); unsupportedOptions.push(g + ".properties." + o);
} }

View File

@ -4301,7 +4301,7 @@
"name": "LaTeX", "name": "LaTeX",
"namespace": "latex" "namespace": "latex"
}, },
"description": "undefined (Supported by Latex Beautify)" "description": " (Supported by Latex Beautify)"
}, },
"disabled": { "disabled": {
"title": "Disable Beautifying Language", "title": "Disable Beautifying Language",
@ -5420,7 +5420,7 @@
"name": "Nginx", "name": "Nginx",
"namespace": "nginx" "namespace": "nginx"
}, },
"description": "undefined (Supported by Nginx Beautify)" "description": " (Supported by Nginx Beautify)"
}, },
"disabled": { "disabled": {
"title": "Disable Beautifying Language", "title": "Disable Beautifying Language",
@ -5808,7 +5808,7 @@
"name": "PHP", "name": "PHP",
"namespace": "php" "namespace": "php"
}, },
"description": "undefined (Supported by PHP-CS-Fixer)" "description": " (Supported by PHP-CS-Fixer)"
}, },
"fixers": { "fixers": {
"type": "string", "type": "string",