-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Disable pylint print statement flag + fix venv detection (#954)
* Basic tokenizer * Fixed property names * Tests, round I * Tests, round II * tokenizer test * Remove temorary change * Fix merge issue * Merge conflict * Merge conflict * Completion test * Fix last line * Fix javascript math * Make test await for results * Add license headers * Rename definitions to types * License headers * Fix typo in completion details (typo) * Fix hover test * Russian translations * Update to better translation * Fix typo * #70 How to get all parameter info when filling in a function param list * Fix #70 How to get all parameter info when filling in a function param list * Clean up * Clean imports * CR feedback * Trim whitespace for test stability * More tests * Better handle no-parameters documentation * Better handle ellipsis and Python3 * #385 Auto-Indentation doesn't work after comment * #141 Auto indentation broken when return keyword involved * Undo changes * #627 Docstrings for builtin methods are not parsed correctly * reStructuredText converter * Fix: period is not an operator * Minor fixes * Restructure * Tests * Tests * Code heuristics * Baselines * HTML handling * Lists * State machine * Baselines * Squash * no message * Whitespace difference * Update Jedi to 0.11.1 * Enable Travis * Test fixes * Undo change * Jedi 0.11 with parser * Undo changes * Undo changes * Test fixes * More tests * Tests * Fix pylint search * Handle quote escapes in strings * Escapes in strings * CR feedback * Discover pylintrc better + tests * Fix .pyenv/versions search * Fix multiple linters output * Better handle markdown underscore * Test * Fix 916: PyLint checks wrong files * Test stability * Try increase timeout * Make sure linting is enabled in tests * Try another way of waiting * Simplify * Fix clear diags on close tests * Try writing settings directly * Increase timeout * Measure test time * Measure time * Simplify * Set timeout * Better venv detection * Add test * More reliable check * Fix pylint switch key * Remove incorrect flag * Disable print * Require pylint 1.8 on CI * Fix working directory for standalone files * Use an 'elif' * Separate file for pylint root config
- Loading branch information
Mikhail Arkhipov
authored
Mar 6, 2018
1 parent
8c94314
commit 77f3612
Showing
7 changed files
with
82 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
autopep8==1.2.1 | ||
yapf==0.6.2 | ||
pylint==1.5.4 | ||
pylint==1.8.2 | ||
pep8==1.7.0 | ||
prospector==0.11.7 | ||
flake8==2.6.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
import { expect } from 'chai'; | ||
import { Container } from 'inversify'; | ||
import * as TypeMoq from 'typemoq'; | ||
import { BufferDecoder } from '../../client/common/process/decoder'; | ||
import { ProcessService } from '../../client/common/process/proc'; | ||
import { IBufferDecoder, IProcessService } from '../../client/common/process/types'; | ||
import { VirtualEnvironmentManager } from '../../client/interpreter/virtualEnvs'; | ||
import { ServiceContainer } from '../../client/ioc/container'; | ||
import { ServiceManager } from '../../client/ioc/serviceManager'; | ||
|
||
suite('Virtual environment manager', () => { | ||
let serviceManager: ServiceManager; | ||
let serviceContainer: ServiceContainer; | ||
let process: TypeMoq.IMock<IProcessService>; | ||
|
||
setup(async () => { | ||
const cont = new Container(); | ||
serviceManager = new ServiceManager(cont); | ||
serviceContainer = new ServiceContainer(cont); | ||
}); | ||
|
||
test('Plain Python environment suffix', async () => await testSuffix('')); | ||
test('Venv environment suffix', async () => await testSuffix('venv')); | ||
test('Virtualenv Python environment suffix', async () => await testSuffix('virtualenv')); | ||
|
||
test('Run actual virtual env detection code', async () => { | ||
serviceManager.addSingleton<IProcessService>(IProcessService, ProcessService); | ||
serviceManager.addSingleton<IBufferDecoder>(IBufferDecoder, BufferDecoder); | ||
const venvManager = new VirtualEnvironmentManager(serviceContainer); | ||
const name = await venvManager.getEnvironmentName('python'); | ||
const result = name === '' || name === 'venv' || name === 'virtualenv'; | ||
expect(result).to.be.equal(true, 'Running venv detection code failed.'); | ||
}); | ||
|
||
async function testSuffix(expectedName: string) { | ||
process = TypeMoq.Mock.ofType<IProcessService>(); | ||
serviceManager.addSingletonInstance<IProcessService>(IProcessService, process.object); | ||
|
||
const venvManager = new VirtualEnvironmentManager(serviceContainer); | ||
process | ||
.setup(x => x.exec('python', TypeMoq.It.isAny())) | ||
.returns(() => Promise.resolve({ | ||
stdout: expectedName, | ||
stderr: '' | ||
})); | ||
|
||
const name = await venvManager.getEnvironmentName('python'); | ||
expect(name).to.be.equal(expectedName, 'Virtual envrironment name suffix is incorrect.'); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
"""pylint option block-disable""" | ||
|
||
__revision__ = None | ||
|
||
class Foo(object): | ||
"""block-disable test""" | ||
|
||
def __init__(self): | ||
pass | ||
|
||
def meth1(self, arg): | ||
"""meth1""" | ||
print self.blop | ||
|
||
def meth2(self, arg): | ||
"""meth2""" | ||
# pylint: disable=unused-argument | ||
print self\ | ||
+ "foo" |