From 80772b5504885be077f7d82c3200670cd45edd76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Nicodemos=20Maia=20Neto?= Date: Tue, 1 Aug 2017 12:57:22 -0300 Subject: [PATCH] Added encoding configuration --- phpcs-server/src/linter.ts | 7 ++++++- phpcs/README.md | 4 ++++ phpcs/package.json | 8 ++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/phpcs-server/src/linter.ts b/phpcs-server/src/linter.ts index 8146747..1080439 100644 --- a/phpcs-server/src/linter.ts +++ b/phpcs-server/src/linter.ts @@ -47,6 +47,7 @@ export interface PhpcsSettings { ignorePatterns?: string[]; warningSeverity?: number; errorSeverity?: number; + encoding?: string; } export interface PhpcsVersion { @@ -314,7 +315,11 @@ export class PhpcsLinter { if (this.version.major > 1 || (this.version.major === 1 && this.version.minor >= 3) ) { - lintArgs.push('--encoding=UTF-8'); + if(settings.encoding !== undefined) { + lintArgs.push(`--encoding=${settings.encoding}`); + } else { + lintArgs.push('--encoding=UTF-8'); + } } if (settings.standard !== undefined) { diff --git a/phpcs/README.md b/phpcs/README.md index d7f83fb..2926592 100755 --- a/phpcs/README.md +++ b/phpcs/README.md @@ -145,6 +145,10 @@ This setting controls the error severity level used by `phpcs`. You may specify [ Optional | **Type:** `number` | **Default:** `null` ] This setting controls the warning severity level used by `phpcs`. You may specify an integer value. +### **phpcs.encoding** + +[ Optional | **Type:** `string` | **Default:** `null` ] +This setting controls the encoding used by `phpcs`. You may specify an string value. ## Acknowledgements diff --git a/phpcs/package.json b/phpcs/package.json index 00d329d..8c2d54d 100755 --- a/phpcs/package.json +++ b/phpcs/package.json @@ -70,6 +70,14 @@ ], "default": null, "description": "Optional. Control the warning severity level." + }, + "phpcs.encoding": { + "type": [ + "string", + "null" + ], + "default": null, + "description": "Optional. Control the enconding." } } }