Reduced verbosity of CLI output for non-error conditions.

This commit is contained in:
Eric Traut 2023-03-22 18:21:31 -06:00
parent 968ffc90fa
commit 98e2134ea7
2 changed files with 8 additions and 18 deletions

View File

@ -658,7 +658,7 @@ export class AnalyzerService {
if (configFilePath) {
projectRoot = getDirectoryPath(configFilePath);
} else {
this._console.info(`No configuration file found.`);
this._console.log(`No configuration file found.`);
configFilePath = undefined;
}
}
@ -673,9 +673,9 @@ export class AnalyzerService {
if (pyprojectFilePath) {
projectRoot = getDirectoryPath(pyprojectFilePath);
this._console.info(`pyproject.toml file found at ${projectRoot}.`);
this._console.log(`pyproject.toml file found at ${projectRoot}.`);
} else {
this._console.info(`No pyproject.toml file found.`);
this._console.log(`No pyproject.toml file found.`);
}
}
@ -840,10 +840,6 @@ export class AnalyzerService {
} else {
reportDuplicateSetting('stubPath', configOptions.stubPath);
}
} else {
if (!configOptions.stubPath) {
configOptions.stubPath = normalizePath(combinePaths(configOptions.projectRoot, 'typings'));
}
}
// Do some sanity checks on the specified settings and report missing
@ -983,21 +979,15 @@ export class AnalyzerService {
}
private _getTypeStubFolder() {
const stubPath = this._configOptions.stubPath;
const stubPath =
this._configOptions.stubPath ?? normalizePath(combinePaths(this._configOptions.projectRoot, 'typings'));
if (!this._typeStubTargetPath || !this._typeStubTargetImportName) {
const errMsg = `Import '${this._typeStubTargetImportName}'` + ` could not be resolved`;
this._console.error(errMsg);
throw new Error(errMsg);
}
if (!stubPath) {
// We should never get here because we always generate a
// default typings path if none was specified.
const errMsg = 'No typings path was specified';
this._console.info(errMsg);
throw new Error(errMsg);
}
const typeStubInputTargetParts = this._typeStubTargetImportName.split('.');
if (typeStubInputTargetParts[0].length === 0) {
// We should never get here because the import resolution
@ -1231,7 +1221,7 @@ export class AnalyzerService {
}
} else if (!this._options.skipScanningUserFiles) {
let fileList: string[] = [];
this._console.info(`Searching for source files`);
this._console.log(`Searching for source files`);
fileList = this._getFileNamesFromFileSpecs();
// getFileNamesFromFileSpecs might have updated configOptions, resync options.

View File

@ -1200,7 +1200,7 @@ export class ConfigOptions {
this.defaultPythonPlatform = host.getPythonPlatform();
if (this.defaultPythonPlatform !== undefined) {
console.info(`Assuming Python platform ${this.defaultPythonPlatform}`);
console.log(`Assuming Python platform ${this.defaultPythonPlatform}`);
}
}