Skip to content

Commit 89299ea

Browse files
Make sure CI fails if tsc fails. (#4882)
(for #611)
1 parent fcf990a commit 89299ea

3 files changed

Lines changed: 22 additions & 8 deletions

File tree

build/ci/templates/test_phases.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,15 +102,22 @@ steps:
102102
inputs:
103103
targets: 'prePublishNonBundle'
104104

105-
# Run the `hygiene` gulp task to ensure that the added code adheres to the
106-
# code standards we are trying to maintain.
105+
# Make sure the project compiles (with strict checks enabled).
107106
# Example command line (windows pwsh):
108-
# > gulp hygiene
107+
# > npx tsc -p ./
109108
- bash: |
110109
npx tsc -p ./
110+
displayName: 'make sure project compiles'
111+
condition: and(succeeded(), contains(variables['TestsToRun'], 'runHygiene'))
112+
113+
# Run tslint on the project source to ensure that the added code adheres
114+
# to the # code standards we are trying to maintain.
115+
# Example command line (windows pwsh):
116+
# > npx tslint ./src/**/*.ts{,x}
117+
- bash: |
111118
npx tslint ./src/**/*.ts{,x}
112119
#npx gulp hygiene
113-
displayName: 'gulp code hygiene'
120+
displayName: 'code hygiene'
114121
condition: and(succeeded(), contains(variables['TestsToRun'], 'runHygiene'))
115122
116123
# Enable test coverage reporting for all subsequent tests (typescript-based)

src/client/activation/languageServer/analysisOptions.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ export class LanguageServerAnalysisOptions implements ILanguageServerAnalysisOpt
6161
const properties: Record<string, {}> = {};
6262

6363
const interpreterInfo = await this.interpreterService.getActiveInterpreter(this.resource);
64+
if (!interpreterInfo) {
65+
// tslint:disable-next-line:no-suspicious-comment
66+
// TODO: How do we handle this? It is pretty unlikely...
67+
throw Error('did not find an active interpreter');
68+
}
6469

6570
// tslint:disable-next-line:no-string-literal
6671
properties['InterpreterPath'] = interpreterInfo.path;
@@ -87,8 +92,8 @@ export class LanguageServerAnalysisOptions implements ILanguageServerAnalysisOpt
8792
properties['DatabasePath'] = path.join(this.context.extensionPath, this.languageServerFolder);
8893

8994
const vars = await this.envVarsProvider.getEnvironmentVariables();
90-
this.envPythonPath = vars.PYTHONPATH;
91-
if (this.envPythonPath && this.envPythonPath.length > 0) {
95+
this.envPythonPath = vars.PYTHONPATH || '';
96+
if (this.envPythonPath !== '') {
9297
const paths = this.envPythonPath.split(this.pathUtils.delimiter).filter(item => item.trim().length > 0);
9398
searchPaths.push(...paths);
9499
}

src/client/activation/languageServer/languageClientFactory.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ export class BaseLanguageClientFactory implements ILanguageClientFactory {
3333

3434
private async getEnvVars(resource: Resource): Promise<NodeJS.ProcessEnv> {
3535
const envVars = await this.environmentActivationService.getActivatedEnvironmentVariables(resource);
36-
const hasEnvVars = envVars && Object.keys(envVars).length > 0;
37-
return hasEnvVars ? envVars : this.envVarsProvider.getEnvironmentVariables(resource);
36+
if (envVars && Object.keys(envVars).length > 0) {
37+
return envVars;
38+
}
39+
return this.envVarsProvider.getEnvironmentVariables(resource);
3840
}
3941
}
4042

0 commit comments

Comments
 (0)