Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion phpcs-server/src/linter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export class PhpcsLinter {
if (standard) {
lintArgs.push(`--standard=${standard}`);
}

lintArgs.push(`--extensions=${settings.extensions.join(',')}`);
// Check if file should be ignored (Skip for in-memory documents)
if (filePath !== undefined && settings.ignorePatterns.length) {
if (semver.gte(this.executableVersion, '3.0.0')) {
Expand Down
3 changes: 2 additions & 1 deletion phpcs-server/src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ export interface PhpcsSettings {
executablePath: string | null;
composerJsonPath: string | null;
standard: string | null;
extensions: string[];
autoConfigSearch: boolean;
showSources: boolean;
showWarnings: boolean;
ignorePatterns: string[];
warningSeverity: number;
errorSeverity: number;
}
}
18 changes: 18 additions & 0 deletions phpcs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,19 @@
"default": null,
"description": "Optional. The name or path of the coding standard to use. Defaults to the one set in phpcs global config."
},
"phpcs.extensions": {
"scope": "resource",
"type": "array",
"items": {
"type": "string",
"title": "Valid extension to check"
},
"default": [
"php",
"inc"
],
"description": "An array of valid file extensions that contain PHP code to lint"
},
"phpcs.autoConfigSearch": {
"scope": "resource",
"type": "boolean",
Expand Down Expand Up @@ -129,5 +142,10 @@
"dependencies": {
"vscode": "^1.1.10",
"vscode-languageclient": "^3.5.0"
},
"__metadata": {
"id": "b0a47156-9132-49a2-bebd-ed16d91b1fa6",
"publisherId": "bc9cf215-ec5e-4767-8196-eb73d1ced313",
"publisherDisplayName": "Ioannis Kappas"
}
}
1 change: 1 addition & 0 deletions phpcs/src/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ export class PhpcsConfiguration extends Disposable {
executablePath: config.get('executablePath'),
composerJsonPath: config.get('composerJsonPath'),
standard: config.get('standard'),
extensions: config.get('extensions'),
autoConfigSearch: config.get('autoConfigSearch'),
showSources: config.get('showSources'),
showWarnings: config.get('showWarnings'),
Expand Down
3 changes: 2 additions & 1 deletion phpcs/src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ export interface PhpcsSettings {
executablePath: string | null;
composerJsonPath: string | null;
standard: string | null;
extensions: string[];
autoConfigSearch: boolean;
showSources: boolean;
showWarnings: boolean;
ignorePatterns: string[];
warningSeverity: number;
errorSeverity: number;
}
}